You are here

public function UserName::buildOptionsForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/user/src/Plugin/views/argument_validator/UserName.php \Drupal\user\Plugin\views\argument_validator\UserName::buildOptionsForm()

Provide the default form for setting options.

Overrides User::buildOptionsForm

File

core/modules/user/src/Plugin/views/argument_validator/UserName.php, line 26
Contains \Drupal\user\Plugin\views\argument_validator\UserName.

Class

UserName
Validates whether a user name is valid.

Namespace

Drupal\user\Plugin\views\argument_validator

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  $entity_type = $this->entityManager
    ->getDefinition('user');
  $form['multiple']['#options'] = array(
    0 => $this
      ->t('Single name', array(
      '%type' => $entity_type
        ->getLabel(),
    )),
    1 => $this
      ->t('One or more names separated by , or +', array(
      '%type' => $entity_type
        ->getLabel(),
    )),
  );
}