You are here

public function SlickSettingsForm::submitForm in Slick Carousel 8

Same name and namespace in other branches
  1. 8.2 slick_ui/src/Form/SlickSettingsForm.php \Drupal\slick_ui\Form\SlickSettingsForm::submitForm()
  2. 7.3 slick_ui/src/Form/SlickSettingsForm.php \Drupal\slick_ui\Form\SlickSettingsForm::submitForm()

Implements \Drupal\Core\Form\FormInterface::submitForm().

Overrides ConfigFormBase::submitForm

File

slick_ui/src/Form/SlickSettingsForm.php, line 82

Class

SlickSettingsForm
Defines the Slick admin settings form.

Namespace

Drupal\slick_ui\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->configFactory
    ->getEditable('slick.settings')
    ->set('slick_css', $form_state
    ->getValue('slick_css'))
    ->set('module_css', $form_state
    ->getValue('module_css'))
    ->save();

  // Invalidate the library discovery cache to update new assets.
  $this->libraryDiscovery
    ->clearCachedDefinitions();
  $this->configFactory
    ->clearStaticCache();
  parent::submitForm($form, $form_state);
}