class PrepareLayoutEvent in Drupal 9
Event fired in #pre_render of \Drupal\layout_builder\Element\LayoutBuilder.
Subscribers to this event can prepare section storage before rendering.
Hierarchy
- class \Drupal\Component\EventDispatcher\Event extends \Symfony\Component\EventDispatcher\Event
- class \Drupal\layout_builder\Event\PrepareLayoutEvent
Expanded class hierarchy of PrepareLayoutEvent
See also
\Drupal\layout_builder\LayoutBuilderEvents::PREPARE_LAYOUT
\Drupal\layout_builder\Element\LayoutBuilder::prepareLayout()
3 files declare their use of PrepareLayoutEvent
- LayoutBuilder.php in core/
modules/ layout_builder/ src/ Element/ LayoutBuilder.php - PrepareLayout.php in core/
modules/ layout_builder/ src/ EventSubscriber/ PrepareLayout.php - TestPrepareLayout.php in core/
modules/ layout_builder/ tests/ modules/ layout_builder_element_test/ src/ EventSubscriber/ TestPrepareLayout.php
File
- core/
modules/ layout_builder/ src/ Event/ PrepareLayoutEvent.php, line 16
Namespace
Drupal\layout_builder\EventView source
class PrepareLayoutEvent extends Event {
/**
* The section storage plugin.
*
* @var \Drupal\layout_builder\SectionStorageInterface
*/
protected $sectionStorage;
/**
* Constructs a new PrepareLayoutEvent.
*
* @param \Drupal\layout_builder\SectionStorageInterface $section_storage
* The section storage preparing the Layout.
*/
public function __construct(SectionStorageInterface $section_storage) {
$this->sectionStorage = $section_storage;
}
/**
* Gets the section storage.
*
* @return \Drupal\layout_builder\SectionStorageInterface
* The section storage.
*/
public function getSectionStorage() : SectionStorageInterface {
return $this->sectionStorage;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
PrepareLayoutEvent:: |
protected | property | The section storage plugin. | |
PrepareLayoutEvent:: |
public | function | Gets the section storage. | |
PrepareLayoutEvent:: |
public | function | Constructs a new PrepareLayoutEvent. |