You are here

public function DblogClearLogForm::buildForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/dblog/src/Form/DblogClearLogForm.php \Drupal\dblog\Form\DblogClearLogForm::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/dblog/src/Form/DblogClearLogForm.php, line 56
Contains \Drupal\dblog\Form\DblogClearLogForm.

Class

DblogClearLogForm
Provides the form that clears out the log.

Namespace

Drupal\dblog\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['dblog_clear'] = array(
    '#type' => 'details',
    '#title' => $this
      ->t('Clear log messages'),
    '#description' => $this
      ->t('This will permanently remove the log messages from the database.'),
  );
  $form['dblog_clear']['clear'] = array(
    '#type' => 'submit',
    '#value' => $this
      ->t('Clear log messages'),
  );
  return $form;
}