function DefaultsEntityForm::buildForm

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

Overrides EntityForm::buildForm

File

core/modules/layout_builder/src/Form/DefaultsEntityForm.php, line 82

Class

DefaultsEntityForm
Provides a form containing the Layout Builder UI for defaults.

Namespace

Drupal\layout_builder\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, SectionStorageInterface $section_storage = NULL) {
    $form['#attributes']['class'][] = 'layout-builder-form';
    $form['layout_builder'] = [
        '#type' => 'layout_builder',
        '#section_storage' => $section_storage,
        '#process' => [
            [
                static::class,
                'layoutBuilderElementGetKeys',
            ],
        ],
    ];
    $form['layout_builder_message'] = $this->buildMessage($section_storage->getContextValue('display'));
    $this->sectionStorage = $section_storage;
    return parent::buildForm($form, $form_state);
}

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