You are here

public function RecaptchaSettingsForm::submitForm in reCAPTCHA 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

lib/Drupal/recaptcha/Form/RecaptchaSettingsForm.php, line 115
Contains \Drupal\recaptcha\Form\RecaptchaSettingsForm.

Class

RecaptchaSettingsForm
Provides the reCAPTCHA administration settings.

Namespace

Drupal\recaptcha\Form

Code

public function submitForm(array &$form, array &$form_state) {
  $this->configFactory
    ->get('recaptcha.settings')
    ->set('recaptcha_public_key', $form_state['values']['recaptcha_public_key'])
    ->set('recaptcha_private_key', $form_state['values']['recaptcha_private_key'])
    ->set('recaptcha_ajax_api', $form_state['values']['recaptcha_ajax_api'])
    ->set('recaptcha_nocookies', $form_state['values']['recaptcha_nocookies'])
    ->set('recaptcha_theme', $form_state['values']['recaptcha_theme'])
    ->set('recaptcha_tabindex', $form_state['values']['recaptcha_tabindex'])
    ->save();
  parent::submitForm($form, $form_state);
}