You are here

public function ResponsiveMenusAdminForm::submitForm in Responsive Menus 8

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/ResponsiveMenusAdminForm.php, line 160

Class

ResponsiveMenusAdminForm
Class ResponsiveMenusAdminForm.

Namespace

Drupal\responsive_menus\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();
  $this
    ->config('responsive_menus.configuration')
    ->set('style', $values['responsive_menus_style'])
    ->set('ignore_admin', $values['responsive_menus_ignore_admin'])
    ->set('style_settings', $values['responsive_menus_style_settings'])
    ->save();

  //  // Clear libraries cache if Sidr style in use to allow theme to be updated.
  //  if ($form_state['values']['responsive_menus_style'] == 'sidr') {
  //    cache_clear_all('*', 'cache_libraries', TRUE);
  //  }
  $this
    ->messenger()
    ->addMessage($this
    ->t('The configuration options have been saved.'));
  parent::submitForm($form, $form_state);
}