You are here

public function DemoResetConfirm::buildForm in Demonstration site (Sandbox / Snapshot) 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 ConfirmFormBase::buildForm

File

src/Form/DemoResetConfirm.php, line 24

Class

DemoResetConfirm
Returns demo_reset_confirm from to make sure that you really want to reset the configuration.

Namespace

Drupal\demo\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['dump'] = demo_get_dumps();
  \Drupal::messenger()
    ->addMessage(t('This action cannot be undone.'), 'warning');
  $form['submit'] = [
    '#type' => 'submit',
    '#value' => t('Reset now'),
  ];
  return $form;
}