public function GeneralSettingsForm::submitForm in Diff 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/ GeneralSettingsForm.php, line 227
Class
- GeneralSettingsForm
- Configure global diff settings.
Namespace
Drupal\diff\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$config = $this
->config('diff.settings');
$keys = array(
'radio_behavior',
'context_lines_leading',
'context_lines_trailing',
'layout_plugins',
'visual_inline_theme',
);
foreach ($keys as $key) {
$config
->set('general_settings.' . $key, $form_state
->getValue($key));
}
$config
->save();
parent::submitForm($form, $form_state);
}