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

Breadcrumb

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

class PrepareLayoutEvent

Event fired in #pre_render of \Drupal\layout_builder\Element\LayoutBuilder.

Subscribers to this event can prepare section storage before rendering.

Hierarchy

  • class \Symfony\Contracts\EventDispatcher\Event implements \Psr\EventDispatcher\StoppableEventInterface
    • class \Drupal\Component\EventDispatcher\Event extends \Symfony\Contracts\EventDispatcher\Event
      • class \Drupal\layout_builder\Event\PrepareLayoutEvent extends \Drupal\Component\EventDispatcher\Event

Expanded class hierarchy of PrepareLayoutEvent

See also

\Drupal\layout_builder\LayoutBuilderEvents::PREPARE_LAYOUT

\Drupal\layout_builder\Element\LayoutBuilder::prepareLayout()

2 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

File

core/modules/layout_builder/src/Event/PrepareLayoutEvent.php, line 16

Namespace

Drupal\layout_builder\Event
View 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

Title Sort descending Modifiers Object type Summary
PrepareLayoutEvent::$sectionStorage protected property The section storage plugin.
PrepareLayoutEvent::getSectionStorage public function Gets the section storage.
PrepareLayoutEvent::__construct public function Constructs a new PrepareLayoutEvent.

API Navigation

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