You are here

public function PersistentLoginSettingsForm::submitForm in Persistent Login 8

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/PersistentLoginSettingsForm.php, line 95

Class

PersistentLoginSettingsForm
Form for editing Persistent Login module settings.

Namespace

Drupal\persistent_login\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('persistent_login.settings')
    ->set('lifetime', $form_state
    ->getValue('lifetime'))
    ->set('max_tokens', $form_state
    ->getValue('max_tokens'))
    ->set('login_form.field_label', $form_state
    ->getValue('field_label'))
    ->set('cookie_prefix', $form_state
    ->getValue('cookie_prefix'))
    ->save();
  parent::submitForm($form, $form_state);
}