You are here

public function YamlFormEntityDeleteForm::buildForm in YAML Form 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 EntityDeleteForm::buildForm

File

src/YamlFormEntityDeleteForm.php, line 16

Class

YamlFormEntityDeleteForm
Provides a delete form.

Namespace

Drupal\yamlform

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form = parent::buildForm($form, $form_state);
  $form['confirm'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Yes, I want to the delete this form.'),
    '#required' => TRUE,
    '#weight' => 10,
  ];
  return $form;
}