public function Display::getLayoutInstance

Returns the instantiated layout object.

Throws

\Exception

Overrides BoundDisplayInterface::getLayoutInstance

1 call to Display::getLayoutInstance()
Display::sortBlocks in drupal/core/modules/layout/lib/Drupal/layout/Plugin/Core/Entity/Display.php
Transform the stored blockConfig into a sorted, region-oriented array.

File

drupal/core/modules/layout/lib/Drupal/layout/Plugin/Core/Entity/Display.php, line 176
Definition of Drupal\layout\Plugin\Core\Entity\Display.

Class

Display
Defines the display entity.

Namespace

Drupal\layout\Plugin\Core\Entity

Code

public function getLayoutInstance() {
  if ($this->layoutInstance === NULL) {
    if (empty($this->layout)) {
      throw new \Exception(sprintf('Display "%id" had no layout plugin attached.', array(
        '%id' => $this
          ->id(),
      )), E_RECOVERABLE_ERROR);
    }
    $this->layoutInstance = layout_manager()
      ->createInstance($this->layout, $this->layoutSettings);

    // @todo add handling for remapping if the layout could not be found
  }
  return $this->layoutInstance;
}