You are here

public function AsciiArtCaptchaSettingsForm::submitForm in CAPTCHA Pack 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

ascii_art_captcha/src/Form/AsciiArtCaptchaSettingsForm.php, line 91

Class

AsciiArtCaptchaSettingsForm
Displays the pants settings form.

Namespace

Drupal\ascii_art_captcha\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('ascii_art_captcha.settings');
  $config
    ->set('ascii_art_captcha_code_length', $form_state
    ->getValue('ascii_art_captcha_code_length'));
  $config
    ->set('ascii_art_captcha_font', $form_state
    ->getValue('ascii_art_captcha_font'));
  $config
    ->set('ascii_art_captcha_font_size', $form_state
    ->getValue('ascii_art_captcha_font_size'));
  $config
    ->set('ascii_art_captcha_allowed_characters', $form_state
    ->getValue('ascii_art_captcha_allowed_characters'));
  $config
    ->save();
  parent::submitForm($form, $form_state);
}