You are here

public function DashboardDeleteBlockForm::buildForm in Draggable dashboard 8.2

Parameters

array $form: Form array.

\Drupal\Core\Form\FormStateInterface $form_state: Form state object.

\Drupal\draggable_dashboard\Entity\DashboardEntityInterface $dashboard_entity: Dashboard object.

string $block_id: ID of the block to delete.

Return value

array

Overrides ConfirmFormBase::buildForm

File

src/Form/DashboardDeleteBlockForm.php, line 84

Class

DashboardDeleteBlockForm
Class DashboardDeleteBlockForm

Namespace

Drupal\draggable_dashboard\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, DashboardEntityInterface $dashboard_entity = NULL, $block_id = '') {

  // During the initial form build, add this form object to the form state and
  // allow for initial preparation before form building and processing.
  if (!$form_state
    ->has('form_initialized')) {
    $this
      ->init($form_state, $dashboard_entity, $block_id);
  }
  $form['block_id'] = [
    '#type' => 'value',
    '#value' => $block_id,
  ];
  return parent::buildForm($form, $form_state);
}