You are here

public function FlexsliderFormSettings::submitForm in Flex Slider 8.2

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/FlexsliderFormSettings.php, line 72

Class

FlexsliderFormSettings
Class FlexsliderFormSettings.

Namespace

Drupal\flexslider\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('flexslider.settings');
  $config
    ->set('flexslider_debug', $form_state
    ->getValue('flexslider_debug'))
    ->set('flexslider_css', $form_state
    ->getValue('flexslider_css'))
    ->set('flexslider_module_css', $form_state
    ->getValue('integration_css'))
    ->save();

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