You are here

public function BlockContentDeleteForm::buildForm in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/block_content/src/Form/BlockContentDeleteForm.php \Drupal\block_content\Form\BlockContentDeleteForm::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 ContentEntityDeleteForm::buildForm

File

core/modules/block_content/src/Form/BlockContentDeleteForm.php, line 21
Contains \Drupal\block_content\Form\BlockContentDeleteForm.

Class

BlockContentDeleteForm
Provides a confirmation form for deleting a custom block entity.

Namespace

Drupal\block_content\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $instances = $this->entity
    ->getInstances();
  $form['message'] = array(
    '#markup' => $this
      ->formatPlural(count($instances), 'This will also remove 1 placed block instance.', 'This will also remove @count placed block instances.'),
    '#access' => !empty($instances),
  );
  return parent::buildForm($form, $form_state);
}