You are here

public function GroupSettingsForm::submitForm in Group 8

Same name and namespace in other branches
  1. 2.0.x src/Form/GroupSettingsForm.php \Drupal\group\Form\GroupSettingsForm::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/GroupSettingsForm.php, line 47

Class

GroupSettingsForm
Class GroupSettingsForm.

Namespace

Drupal\group\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('group.settings');
  $conf_admin_theme = $config
    ->get('use_admin_theme');
  $form_admin_theme = $form_state
    ->getValue('use_admin_theme');

  // Only rebuild the routes if the admin theme switch has changed.
  if ($conf_admin_theme != $form_admin_theme) {
    $config
      ->set('use_admin_theme', $form_admin_theme)
      ->save();
    \Drupal::service('router.builder')
      ->setRebuildNeeded();
  }
  parent::submitForm($form, $form_state);
}