You are here

public function SecurepagesSettingsForm::submitForm in Secure Pages 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/SecurepagesSettingsForm.php, line 128
Contains \Drupal\securepages\Form\SecurepagesSettingsForm.

Class

SecurepagesSettingsForm
Defines a form that configures forms module settings.

Namespace

Drupal\securepages\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('securepages.settings')
    ->set('enable', $form_state
    ->getValue('enable'))
    ->set('switch', $form_state
    ->getValue('switch'))
    ->set('basepath', $form_state
    ->getValue('basepath'))
    ->set('basepath_ssl', $form_state
    ->getValue('basepath_ssl'))
    ->set('secure', $form_state
    ->getValue('secure'))
    ->set('pages', $this::explodeValues($form_state
    ->getValue('pages')))
    ->set('ignore', $this::explodeValues($form_state
    ->getValue('ignore')))
    ->set('roles', array_filter($form_state
    ->getValue('roles')))
    ->set('forms', $this::explodeValues($form_state
    ->getValue('forms')))
    ->set('debug', $form_state
    ->getValue('debug'))
    ->save();
  parent::submitForm($form, $form_state);
}