function ClearCacheForm::submitForm

Same name and namespace in other branches
  1. 10 core/modules/system/src/Form/ClearCacheForm.php \Drupal\system\Form\ClearCacheForm::submitForm()

Clears the caches.

Overrides FormInterface::submitForm

File

core/modules/system/src/Form/ClearCacheForm.php, line 44

Class

ClearCacheForm
Clear caches for this site.

Namespace

Drupal\system\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
    drupal_flush_all_caches();
    $this->messenger()
        ->addStatus($this->t('Caches cleared.'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.