public function PerformanceForm::submitForm in Drupal 8
Same name and namespace in other branches
- 9 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 175
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
->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);
}