You are here

public function SettingsForm::submitForm in Anonymous CSRF Token 2.x

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/SettingsForm.php, line 48

Class

SettingsForm
Class SettingsForm.

Namespace

Drupal\anonymous_token\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $this
    ->config('anonymous_token.settings')
    ->set('force_single_use', (bool) $form_state
    ->getValue('force_single_use'))
    ->save();
}