public function EnvironmentIndicatorSettingsForm::submitForm in Environment Indicator 8.3
Same name and namespace in other branches
- 8.2 lib/Drupal/environment_indicator/Form/EnvironmentIndicatorSettingsForm.php \Drupal\environment_indicator\Form\EnvironmentIndicatorSettingsForm::submitForm()
- 4.x src/Form/EnvironmentIndicatorSettingsForm.php \Drupal\environment_indicator\Form\EnvironmentIndicatorSettingsForm::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/ EnvironmentIndicatorSettingsForm.php, line 55
Class
- EnvironmentIndicatorSettingsForm
- Basic Environment Indicator controls form.
Namespace
Drupal\environment_indicator\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = $this
->config('environment_indicator.settings');
$properties = [
'toolbar_integration',
'favicon',
];
array_walk($properties, function ($property) use ($config, $form_state) {
$config
->set($property, $form_state
->getValue($property));
});
$config
->save();
parent::submitForm($form, $form_state);
}