public function SettingsForm::submitForm in Sidr: Accessible Mobile Menus 8.3
Same name and namespace in other branches
- 8 src/Form/SettingsForm.php \Drupal\sidr\Form\SettingsForm::submitForm()
- 8.2 src/Form/SettingsForm.php \Drupal\sidr\Form\SettingsForm::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/ SettingsForm.php, line 67
Class
- SettingsForm
- Global sidr settings form.
Namespace
Drupal\sidr\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$keys = [
'sidr_theme',
'close_on_escape',
'close_on_blur',
];
// Save configuration changes.
$config = $this
->config('sidr.settings');
foreach ($keys as $key) {
$config
->set($key, $form_state
->getValue($key));
}
$config
->save();
parent::submitForm($form, $form_state);
}