You are here

public function SettingsForm::submitForm in Disable Login Page 1.0.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 112

Class

SettingsForm
Class SettingsForm.

Namespace

Drupal\disable_login\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $settings = $this
    ->config('disable_login.settings');
  $settings
    ->set('disable_login', $form_state
    ->getValue('disable_login'))
    ->set('querystring', $form_state
    ->getValue('querystring'))
    ->set('secret', $form_state
    ->getValue('secret'));
  $settings
    ->save();
}