You are here

public function HstsConfigForm::submitForm in HTTP Strict Transport Security 8

.

Overrides ConfigFormBase::submitForm

File

src/Form/HstsConfigForm.php, line 102
Contains \Drupal\hsts\Form\HstsConfigForm.

Class

HstsConfigForm
Implements a Hsts Config form.

Namespace

Drupal\hsts\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('hsts.settings')
    ->set('enabled', $form_state
    ->getValue('enabled'))
    ->set('max_age', $form_state
    ->getValue('max_age'))
    ->set('subdomains', $form_state
    ->getValue('subdomains'))
    ->set('preload', $form_state
    ->getValue('preload'))
    ->save();
  parent::submitForm($form, $form_state);
}