You are here

public function BUEditorSettingsForm::submitForm in BUEditor 8

Same name and namespace in other branches
  1. 8.2 src/Form/BUEditorSettingsForm.php \Drupal\bueditor\Form\BUEditorSettingsForm::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/BUEditorSettingsForm.php, line 45

Class

BUEditorSettingsForm
BUEditor settings form.

Namespace

Drupal\bueditor\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('bueditor.settings');

  // Invalidate library cache if devmode has changed.
  $devmode = $form_state
    ->getValue('devmode');
  if ($config
    ->get('devmode') != $devmode) {
    \Drupal::cache('discovery')
      ->invalidate('library_info');
  }

  // Save config
  $config
    ->set('devmode', $devmode)
    ->save();
  parent::submitForm($form, $form_state);
}