public function PasswordSettingsForm::buildForm in View Password 6.0.x
Same name and namespace in other branches
- 8.5 src/Form/PasswordSettingsForm.php \Drupal\view_password\Form\PasswordSettingsForm::buildForm()
- 8.4 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
Namespace
Drupal\view_password\FormCode
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'),
];
$form['span_classes'] = [
'#type' => 'textarea',
'#title' => $this
->t('Enter the form class here.'),
'#description' => $this
->t('Please enter the icon span class(es) by separating it with a space.'),
'#default_value' => $config
->get('span_classes'),
];
return $form;
}