You are here

public function SettingsForm::submitForm in Lightning Media 8

Same name and namespace in other branches
  1. 8.4 src/Form/SettingsForm.php \Drupal\lightning_media\Form\SettingsForm::submitForm()
  2. 8.2 src/Form/SettingsForm.php \Drupal\lightning_media\Form\SettingsForm::submitForm()
  3. 8.3 src/Form/SettingsForm.php \Drupal\lightning_media\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

src/Form/SettingsForm.php, line 42

Class

SettingsForm
The settings form for controlling Lightning Media's behavior.

Namespace

Drupal\lightning_media\Form

Code

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