You are here

public function DemoConfigResetConfirm::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/DemoConfigResetConfirm.php, line 27

Class

DemoConfigResetConfirm
This class return the form demo_config_reset_confirm to make sure that you are about to reset your configuration.

Namespace

Drupal\demo\Form

Code

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