You are here

public function PasswordSettingsForm::buildForm in View Password 8.5

Same name and namespace in other branches
  1. 8.4 src/Form/PasswordSettingsForm.php \Drupal\view_password\Form\PasswordSettingsForm::buildForm()
  2. 6.0.x src/Form/PasswordSettingsForm.php \Drupal\view_password\Form\PasswordSettingsForm::buildForm()

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides ConfigFormBase::buildForm

File

src/Form/PasswordSettingsForm.php, line 25

Class

PasswordSettingsForm

Namespace

Drupal\view_password\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form = parent::buildForm($form, $form_state);
  $config = $this
    ->config('view_password.settings');
  $form['form_id_pwd'] = [
    '#type' => 'textarea',
    '#title' => $this
      ->t('Enter the form id here.'),
    '#description' => $this
      ->t('Please enter the form id(s) by separating it with a comma. Here the default is user_login_form. You can remove and save the form if you do not want to display the password for this form.'),
    '#default_value' => $config
      ->get('form_ids'),
  ];
  return $form;
}