You are here

public function BetterPasswordsSettingsForm::submitForm in Better Passwords 8

Same name and namespace in other branches
  1. 2.x src/Form/BetterPasswordsSettingsForm.php \Drupal\better_passwords\Form\BetterPasswordsSettingsForm::submitForm()

Form submission handler.

Parameters

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

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

Overrides ConfigFormBase::submitForm

File

src/Form/BetterPasswordsSettingsForm.php, line 75

Class

BetterPasswordsSettingsForm
Implements a form for general settings on better passwords.

Namespace

Drupal\better_passwords\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('better_passwords.settings')
    ->set('length', $form_state
    ->getValue('length'))
    ->set('strength', $form_state
    ->getValue('strength'))
    ->set('auto_generate', $form_state
    ->getValue('auto_generate'))
    ->save();
  parent::submitForm($form, $form_state);
}