public function SiteMaintenanceModeForm::submitForm in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/system/src/Form/SiteMaintenanceModeForm.php \Drupal\system\Form\SiteMaintenanceModeForm::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
- core/
modules/ system/ src/ Form/ SiteMaintenanceModeForm.php, line 87 - Contains \Drupal\system\Form\SiteMaintenanceModeForm.
Class
- SiteMaintenanceModeForm
- Configure maintenance settings for this site.
Namespace
Drupal\system\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$this
->config('system.maintenance')
->set('message', $form_state
->getValue('maintenance_mode_message'))
->save();
$this->state
->set('system.maintenance_mode', $form_state
->getValue('maintenance_mode'));
parent::submitForm($form, $form_state);
}