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

Breadcrumb

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

function 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 67

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;
    if ($this->plugin instanceof PreviewAwarePluginInterface) {
        $this->plugin
            ->setInPreview($in_preview);
    }
}

API Navigation

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