You are here

protected function LayoutParagraphsBuilder::layoutPluginInstance in Layout Paragraphs 2.0.x

Loads a layout plugin instance for a layout paragraph section.

Parameters

\Drupal\layout_paragraphs\LayoutParagraphsSection $section: The section.

2 calls to LayoutParagraphsBuilder::layoutPluginInstance()
LayoutParagraphsBuilder::buildComponent in src/Element/LayoutParagraphsBuilder.php
Returns the build array for a single layout component.
LayoutParagraphsBuilder::preRender in src/Element/LayoutParagraphsBuilder.php
Pre-render callback: Renders the UI.

File

src/Element/LayoutParagraphsBuilder.php, line 519

Class

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

Namespace

Drupal\layout_paragraphs\Element

Code

protected function layoutPluginInstance(LayoutParagraphsSection $section) {
  $layout_id = $section
    ->getLayoutId();
  $layout_config = $section
    ->getLayoutConfiguration();
  $layout_instance = $this->layoutPluginManager
    ->createInstance($layout_id, $layout_config);
  return $layout_instance;
}