Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Section.php

function Section::getLayout

Gets the layout plugin for this section.

Parameters

\Drupal\Core\Plugin\Context\ContextInterface[] $contexts: An array of available contexts.

Return value

\Drupal\Core\Layout\LayoutInterface The layout plugin.

1 call to Section::getLayout()
Section::toRenderArray in core/modules/layout_builder/src/Section.php
Returns the renderable array for this section.

File

core/modules/layout_builder/src/Section.php, line 115

Class

Section
Provides a domain object for layout sections.

Namespace

Drupal\layout_builder

Code

public function getLayout(array $contexts = []) {
    $layout = $this->layoutPluginManager()
        ->createInstance($this->getLayoutId(), $this->layoutSettings);
    if ($contexts) {
        $this->contextHandler()
            ->applyContextMapping($layout, $contexts);
    }
    return $layout;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal