You are here

public function ToolbarSettingsForm::submitForm in Devel 8

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

Class

ToolbarSettingsForm
Configures devel toolbar settings.

Namespace

Drupal\devel\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();
  $toolbar_items = array_keys(array_filter($values['toolbar_items']));
  $this
    ->config('devel.toolbar.settings')
    ->set('toolbar_items', $toolbar_items)
    ->save();
  parent::submitForm($form, $form_state);
}