You are here

public function SectionComponentBuildRenderArrayEvent::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/src/Event/SectionComponentBuildRenderArrayEvent.php \Drupal\layout_builder\Event\SectionComponentBuildRenderArrayEvent::__construct()

Creates a new SectionComponentBuildRenderArrayEvent object.

Parameters

\Drupal\layout_builder\SectionComponent $component: The section component whose render array is being built.

\Drupal\Core\Plugin\Context\ContextInterface[] $contexts: The available contexts.

bool $in_preview: (optional) Whether the component is in preview mode or not.

File

core/modules/layout_builder/src/Event/SectionComponentBuildRenderArrayEvent.php, line 66

Class

SectionComponentBuildRenderArrayEvent
Event fired when a section component's render array is being built.

Namespace

Drupal\layout_builder\Event

Code

public function __construct(SectionComponent $component, array $contexts, $in_preview = FALSE) {
  $this->component = $component;
  $this->contexts = $contexts;
  $this->plugin = $component
    ->getPlugin($contexts);
  $this->inPreview = $in_preview;
}