You are here

public function SettingsForm::submitForm in Drupal 9

Same name in this branch
  1. 9 core/modules/media_library/src/Form/SettingsForm.php \Drupal\media_library\Form\SettingsForm::submitForm()
  2. 9 core/modules/aggregator/src/Form/SettingsForm.php \Drupal\aggregator\Form\SettingsForm::submitForm()
Same name and namespace in other branches
  1. 8 core/modules/media_library/src/Form/SettingsForm.php \Drupal\media_library\Form\SettingsForm::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

core/modules/media_library/src/Form/SettingsForm.php, line 46

Class

SettingsForm
Defines a form for configuring the Media Library module.

Namespace

Drupal\media_library\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('media_library.settings')
    ->set('advanced_ui', (bool) $form_state
    ->getValue('advanced_ui'))
    ->save();
  parent::submitForm($form, $form_state);
}