function UpdateBlockForm::buildForm

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/src/Form/UpdateBlockForm.php \Drupal\layout_builder\Form\UpdateBlockForm::buildForm()
  2. 8.9.x core/modules/layout_builder/src/Form/UpdateBlockForm.php \Drupal\layout_builder\Form\UpdateBlockForm::buildForm()
  3. 10 core/modules/layout_builder/src/Form/UpdateBlockForm.php \Drupal\layout_builder\Form\UpdateBlockForm::buildForm()

Builds the block form.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

\Drupal\layout_builder\SectionStorageInterface $section_storage: The section storage being configured.

int $delta: The delta of the section.

string $region: The region of the block.

string $uuid: The UUID of the block being updated.

Return value

array The form array.

Overrides FormInterface::buildForm

File

core/modules/layout_builder/src/Form/UpdateBlockForm.php, line 45

Class

UpdateBlockForm
Provides a form to update a block.

Namespace

Drupal\layout_builder\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, ?SectionStorageInterface $section_storage = NULL, $delta = NULL, $region = NULL, $uuid = NULL) {
    $component = $section_storage->getSection($delta)
        ->getComponent($uuid);
    $form['#attributes']['data-layout-builder-target-highlight-id'] = $this->blockUpdateHighlightId($uuid);
    return $this->doBuildForm($form, $form_state, $section_storage, $delta, $component);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.