function ToolbarSettingsForm::submitForm

Same name in other branches
  1. 4.x src/Form/ToolbarSettingsForm.php \Drupal\devel\Form\ToolbarSettingsForm::submitForm()

Overrides ConfigFormBase::submitForm

File

src/Form/ToolbarSettingsForm.php, line 69

Class

ToolbarSettingsForm
Configures devel toolbar settings.

Namespace

Drupal\devel\Form

Code

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