You are here

public function BrokenLinkDeleteForm::buildForm in Broken Link 8.3

Same name and namespace in other branches
  1. 8 src/Form/BrokenLinkDeleteForm.php \Drupal\broken_link\Form\BrokenLinkDeleteForm::buildForm()
  2. 8.2 src/Form/BrokenLinkDeleteForm.php \Drupal\broken_link\Form\BrokenLinkDeleteForm::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 EntityConfirmFormBase::buildForm

File

src/Form/BrokenLinkDeleteForm.php, line 38

Class

BrokenLinkDeleteForm
Builds the form to delete Broken link entity entities.

Namespace

Drupal\broken_link\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['#title'] = $this
    ->getQuestion();
  $form['#attributes']['class'][] = 'confirmation';
  $form['description'] = array(
    '#markup' => $this
      ->getDescription(),
  );
  $form[$this
    ->getFormName()] = array(
    '#type' => 'hidden',
    '#value' => 1,
  );

  // By default, render the form using theme_confirm_form().
  if (!isset($form['#theme'])) {
    $form['#theme'] = 'confirm_form';
  }
  $actions = $this
    ->actionsElement($form, $form_state);
  if (!empty($actions)) {
    $form['actions'] = $actions;
  }
  return $form;
}