You are here

public function LayoutBuilderForm::buildForm in Layout builder library 8

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 EntityForm::buildForm

File

src/Form/LayoutBuilderForm.php, line 54

Class

LayoutBuilderForm
Provides a form containing the Layout Builder UI for Layout Library.

Namespace

Drupal\layout_library\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, SectionStorageInterface $section_storage = NULL) {
  $form['layout_builder'] = [
    '#type' => 'layout_builder',
    '#section_storage' => $section_storage,
  ];
  $this->sectionStorage = $section_storage;
  return parent::buildForm($form, $form_state);
}