You are here

public function SecKitSettingsForm::submitForm in Security Kit 8

Same name and namespace in other branches
  1. 2.x src/Form/SecKitSettingsForm.php \Drupal\seckit\Form\SecKitSettingsForm::submitForm()

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/SecKitSettingsForm.php, line 789

Class

SecKitSettingsForm
Implements a form to collect security check configuration.

Namespace

Drupal\seckit\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $list = [];
  $this
    ->buildAttributeList($list, $form_state
    ->getValues());
  $config = $this
    ->config('seckit.settings');
  foreach ($list as $key => $value) {
    $config
      ->set($key, $value);
  }
  $config
    ->save();
  parent::submitForm($form, $form_state);
}