function LayoutBuilder::preRender

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

Pre-render callback: Renders the Layout Builder UI.

File

core/modules/layout_builder/src/Element/LayoutBuilder.php, line 95

Class

LayoutBuilder
Defines a render element for building the Layout Builder UI.

Namespace

Drupal\layout_builder\Element

Code

public function preRender($element) {
    if ($element['#section_storage'] instanceof SectionStorageInterface) {
        $element['layout_builder'] = $this->layout($element['#section_storage']);
    }
    return $element;
}

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