You are here

public function VariantPluginAddBlockForm::buildForm in Page Manager 8.4

Same name and namespace in other branches
  1. 8 page_manager_ui/src/Form/VariantPluginAddBlockForm.php \Drupal\page_manager_ui\Form\VariantPluginAddBlockForm::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 VariantPluginConfigureBlockFormBase::buildForm

File

page_manager_ui/src/Form/VariantPluginAddBlockForm.php, line 65

Class

VariantPluginAddBlockForm
Provides a form for adding a block plugin to a variant.

Namespace

Drupal\page_manager_ui\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $block_display = NULL, $block_id = NULL, Request $request = NULL) {
  $form = parent::buildForm($form, $form_state, $block_display, $block_id);
  $form['region']['#default_value'] = $request->query
    ->get('region');
  return $form;
}