You are here

public function LoggerClearForm::buildForm in MongoDB 8

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

src/Form/LoggerClearForm.php, line 47
Contains \Drupal\mongodb\Logger\LoggerClearForm.php

Class

LoggerClearForm
Provides the form that clears out the log.

Namespace

Drupal\mongodb\Form

Code

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