function ClearCacheForm::buildForm

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

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides FormInterface::buildForm

File

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

Class

ClearCacheForm
Clear caches for this site.

Namespace

Drupal\system\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
    $form['clear_cache'] = [
        '#type' => 'details',
        '#title' => $this->t('Clear cache'),
        '#open' => TRUE,
    ];
    $form['clear_cache']['clear'] = [
        '#type' => 'submit',
        '#value' => $this->t('Clear all caches'),
    ];
    return $form;
}

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