public function UserName::buildOptionsForm in Drupal 10
Same name and namespace in other branches
- 8 core/modules/user/src/Plugin/views/argument_validator/UserName.php \Drupal\user\Plugin\views\argument_validator\UserName::buildOptionsForm()
- 9 core/modules/user/src/Plugin/views/argument_validator/UserName.php \Drupal\user\Plugin\views\argument_validator\UserName::buildOptionsForm()
Overrides User::buildOptionsForm
File
- core/
modules/ user/ src/ Plugin/ views/ argument_validator/ UserName.php, line 21
Class
- UserName
- Validates whether a user name is valid.
Namespace
Drupal\user\Plugin\views\argument_validatorCode
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$entity_type = $this->entityTypeManager
->getDefinition('user');
$form['multiple']['#options'] = [
0 => $this
->t('Single name', [
'%type' => $entity_type
->getLabel(),
]),
1 => $this
->t('One or more names separated by , or +', [
'%type' => $entity_type
->getLabel(),
]),
];
}