You are here

public function AdminSettingsForm::submitForm in CacheExclude 8

Same name and namespace in other branches
  1. 1.0.x src/Form/AdminSettingsForm.php \Drupal\cacheexclude\Form\AdminSettingsForm::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/AdminSettingsForm.php, line 58

Class

AdminSettingsForm
Contribute form.

Namespace

Drupal\cacheexclude\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {

  // Clear the page cache when new settings are added.
  drupal_flush_all_caches();
  $config = \Drupal::service('config.factory')
    ->getEditable('cacheexclude.settings');
  $config
    ->set('cacheexclude_list', $form_state
    ->getValue('cacheexclude_list'))
    ->save();
  $config
    ->set('cacheexclude_node_types', $form_state
    ->getValue('cacheexclude_node_types'))
    ->save();
  parent::submitForm($form, $form_state);
}