By tim.plunkett on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.7.x
Introduced in version:
8.7.0
Issue links:
Description:
The Layout Builder UI is already rendered from multiple places, and that need will only increase.
A new RenderElement plugin has been added to address this need.
Given an instance of \Drupal\layout_builder\SectionStorageInterface, here is the before and after code:
Before
$layout_controller = \Drupal::classResolver(\Drupal\layout_builder\Controller\LayoutBuilderController::class);
return $layout_controller->layout($section_storage);
After
return [
'#type' => 'layout_builder',
'#section_storage' => $section_storage,
];
Impacts:
Module developers
Themers