You are here

final class LayoutBuilderEvents in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/LayoutBuilderEvents.php \Drupal\layout_builder\LayoutBuilderEvents

Defines events for the layout_builder module.

Hierarchy

Expanded class hierarchy of LayoutBuilderEvents

See also

\Drupal\layout_builder\Event\SectionComponentBuildRenderArrayEvent

5 files declare their use of LayoutBuilderEvents
BlockComponentRenderArray.php in core/modules/layout_builder/src/EventSubscriber/BlockComponentRenderArray.php
LayoutBuilder.php in core/modules/layout_builder/src/Element/LayoutBuilder.php
PrepareLayout.php in core/modules/layout_builder/src/EventSubscriber/PrepareLayout.php
SectionComponentTest.php in core/modules/layout_builder/tests/src/Unit/SectionComponentTest.php
TestPrepareLayout.php in core/modules/layout_builder/tests/modules/layout_builder_element_test/src/EventSubscriber/TestPrepareLayout.php

File

core/modules/layout_builder/src/LayoutBuilderEvents.php, line 10

Namespace

Drupal\layout_builder
View source
final class LayoutBuilderEvents {

  /**
   * Name of the event fired when a component's render array is built.
   *
   * This event allows modules to collaborate on creating the render array of
   * the SectionComponent object. The event listener method receives a
   * \Drupal\layout_builder\Event\SectionComponentBuildRenderArrayEvent
   * instance.
   *
   * @Event
   *
   * @see \Drupal\layout_builder\Event\SectionComponentBuildRenderArrayEvent
   * @see \Drupal\layout_builder\SectionComponent::toRenderArray()
   *
   * @var string
   */
  const SECTION_COMPONENT_BUILD_RENDER_ARRAY = 'section_component.build.render_array';

  /**
   * Name of the event fired in when preparing a layout builder element.
   *
   * This event allows modules to collaborate on creating the sections used in
   * \Drupal\layout_builder\Element\LayoutBuilder during #pre_render.
   *
   * @see \Drupal\layout_builder\Event\PrepareLayoutEvent
   * @see \Drupal\layout_builder\Element\LayoutBuilder
   *
   * @var string
   */
  const PREPARE_LAYOUT = 'prepare_layout';

}

Members

Namesort descending Modifiers Type Description Overrides
LayoutBuilderEvents::PREPARE_LAYOUT constant Name of the event fired in when preparing a layout builder element.
LayoutBuilderEvents::SECTION_COMPONENT_BUILD_RENDER_ARRAY constant Name of the event fired when a component's render array is built.