You are here

public function KeyAuthSettingsForm::submitForm in Key auth 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/KeyAuthSettingsForm.php, line 74

Class

KeyAuthSettingsForm
Class KeyAuthSettingsForm.

Namespace

Drupal\key_auth\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $this
    ->config('key_auth.settings')
    ->set('auto_generate_keys', (bool) $form_state
    ->getValue('auto_generate_keys'))
    ->set('key_length', $form_state
    ->getValue('key_length'))
    ->set('param_name', $form_state
    ->getValue('param_name'))
    ->set('detection_methods', array_values($form_state
    ->getValue('detection_methods')))
    ->save();
}