You are here

public function PanelsAddBlockForm::buildForm in Panels 8.4

Same name and namespace in other branches
  1. 8.3 src/Form/PanelsAddBlockForm.php \Drupal\panels\Form\PanelsAddBlockForm::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 PanelsBlockConfigureFormBase::buildForm

File

src/Form/PanelsAddBlockForm.php, line 65

Class

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

Namespace

Drupal\panels\Form

Code

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