You are here

public function DefaultForm::submitForm in Toolbar Visibility 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/DefaultForm.php, line 72
Contains Drupal\toolbar_visibility\Form\DefaultForm.

Class

DefaultForm
Class DefaultForm.

Namespace

Drupal\toolbar_visibility\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $values = $form_state
    ->cleanValues()
    ->getValues();
  $this
    ->config('toolbar_visibility.default_config')
    ->set('toolbar_visibility_theme', $values['toolbar_visibility_theme'])
    ->save();
}