public function PerformanceForm::submitForm in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/system/src/Form/PerformanceForm.php \Drupal\system\Form\PerformanceForm::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
- core/
modules/ system/ src/ Form/ PerformanceForm.php, line 173 - Contains \Drupal\system\Form\PerformanceForm.
Class
- PerformanceForm
- Configure performance settings for this site.
Namespace
Drupal\system\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->cssCollectionOptimizer
->deleteAll();
$this->jsCollectionOptimizer
->deleteAll();
// This form allows page compression settings to be changed, which can
// invalidate cached pages in the render cache, so it needs to be cleared on
// form submit.
$this->renderCache
->deleteAll();
$this
->config('system.performance')
->set('cache.page.max_age', $form_state
->getValue('page_cache_maximum_age'))
->set('css.preprocess', $form_state
->getValue('preprocess_css'))
->set('js.preprocess', $form_state
->getValue('preprocess_js'))
->save();
parent::submitForm($form, $form_state);
}