public function SiteMaintenanceModeForm::submitForm

Implements \Drupal\Core\Form\FormInterface::submitForm().

Overrides SystemConfigFormBase::submitForm

File

drupal/core/modules/system/lib/Drupal/system/Form/SiteMaintenanceModeForm.php, line 47
Contains \Drupal\system\Form\SiteMaintenanceModeForm.

Class

SiteMaintenanceModeForm
Configure maintenance settings for this site.

Namespace

Drupal\system\Form

Code

public function submitForm(array &$form, array &$form_state) {
  $this->configFactory
    ->get('system.maintenance')
    ->set('enabled', $form_state['values']['maintenance_mode'])
    ->set('message', $form_state['values']['maintenance_mode_message'])
    ->save();
  parent::submitForm($form, $form_state);
}