You are here

public function UnboundDisplayInterface::generateDisplay in Layout 8.2

Returns a bound display entity by binding a layout to this unbound display.

This will DisplayInterface::mapBlocksToLayout() using the provided layout, then create and return a new Display object with the output. This is just a factory - calling code is responsible for saving the returned object.

Parameters

\Drupal\layout\Plugin\LayoutInterface $layout: The desired layout.

string $id: The entity id to assign to the newly created entity.

string $entity_type: The type of entity to create. The PHP class for this entity type must implement \Drupal\layout\Config\BoundDisplayInterface.

Return value

\Drupal\layout\Config\BoundDisplayInterface The newly created entity.

1 method overrides UnboundDisplayInterface::generateDisplay()
UnboundDisplay::generateDisplay in lib/Drupal/layout/Entity/UnboundDisplay.php
Implements UnboundDisplayInterface::generateDisplay().

File

lib/Drupal/layout/Config/UnboundDisplayInterface.php, line 45
Definition of Drupal\layout\Config\UnboundDisplayInterface

Class

UnboundDisplayInterface
Interface for a Display that is not coupled with any layout.

Namespace

Drupal\layout\Config

Code

public function generateDisplay(LayoutInterface $layout, $id, $entity_type = 'display');