public function FormModeManagerForm::submitForm in Form mode manager 8
Same name and namespace in other branches
- 8.2 src/Form/FormModeManagerForm.php \Drupal\form_mode_manager\Form\FormModeManagerForm::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/ FormModeManagerForm.php, line 126
Class
- FormModeManagerForm
- Configure Form Mode Manager common settings.
Namespace
Drupal\form_mode_manager\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
parent::submitForm($form, $form_state);
$form_modes = $this->formModeManager
->getAllFormModesDefinitions(TRUE);
foreach ($form_modes as $entity_type_id => $modes) {
$this->settings
->set("form_modes.{$entity_type_id}.to_exclude", $form_state
->getValue('element_' . $entity_type_id));
}
$this->settings
->save();
$this->cacheTagsInvalidator
->invalidateTags([
'routes',
'rendered',
'local_tasks',
'local_task',
'local_action',
'entity_bundles',
]);
}