You are here

public function BlockBase::buildConfigurationForm in Drupal 10

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Block/BlockBase.php \Drupal\Core\Block\BlockBase::buildConfigurationForm()

File

core/lib/Drupal/Core/Block/BlockBase.php, line 34

Class

BlockBase
Defines a base block implementation that most blocks plugins will extend.

Namespace

Drupal\Core\Block

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
  $form = $this
    ->traitBuildConfigurationForm($form, $form_state);

  // Add context mapping UI form elements.
  $contexts = $form_state
    ->getTemporaryValue('gathered_contexts') ?: [];
  $form['context_mapping'] = $this
    ->addContextAssignmentElement($this, $contexts);
  return $form;
}