You are here

public function CommonSettingsPageForm::submitForm in Multiple Registration 8

Same name and namespace in other branches
  1. 8.2 src/Form/CommonSettingsPageForm.php \Drupal\multiple_registration\Form\CommonSettingsPageForm::submitForm()
  2. 3.x src/Form/CommonSettingsPageForm.php \Drupal\multiple_registration\Form\CommonSettingsPageForm::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/CommonSettingsPageForm.php, line 108

Class

CommonSettingsPageForm
Class DeleteRegistrationPageForm.

Namespace

Drupal\multiple_registration\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $disable_main = $form_state
    ->getValue('disable_main_register_page');
  $clicked_button = end($form_state
    ->getTriggeringElement()['#parents']);
  switch ($clicked_button) {
    case 'save':
      $this
        ->config('multiple_registration.common_settings_page_form_config')
        ->set('multiple_registration_disable_main', $disable_main)
        ->save();
      $this->routeBuilder
        ->rebuild();
      $this->cacheRender
        ->invalidateAll();
      break;
  }
  $form_state
    ->setRedirect('multiple_registration.multiple_registration_list_index');
}