SectionComponentBuildRenderArrayEvent
class SectionComponentBuildRenderArrayEvent extends Event (View source)
Event fired when a section component's render array is being built.
Subscribers to this event should manipulate the cacheability object and the build array in this event.
Traits
Provides an implementation of CacheableResponseInterface.
Properties
| protected CacheableMetadata | $cacheabilityMetadata | The cacheability metadata. |
from CacheableResponseTrait |
| protected SectionComponent | $component | The section component whose render array is being built. |
|
| protected ContextInterface[] | $contexts | The available contexts. |
|
| protected PluginInspectionInterface | $plugin | The plugin for the section component being built. |
|
| protected bool | $inPreview | Whether the component is in preview mode or not. |
|
| protected array | $build | The render array built by the event subscribers. |
Methods
Creates a new SectionComponentBuildRenderArrayEvent object.
Get the section component whose render array is being built.
Get the available contexts.
Get the plugin for the section component being built.
Determine if the component is in preview mode.
Get the render array in its current state.
Set the render array.
Details
addCacheableDependency($dependency)
{@inheritdoc}
getCacheableMetadata()
{@inheritdoc}
__construct(SectionComponent $component, array $contexts, bool $in_preview = FALSE)
Creates a new SectionComponentBuildRenderArrayEvent object.
SectionComponent
getComponent()
Get the section component whose render array is being built.
array|ContextInterface[]
getContexts()
Get the available contexts.
PluginInspectionInterface
getPlugin()
Get the plugin for the section component being built.
bool
inPreview()
Determine if the component is in preview mode.
array
getBuild()
Get the render array in its current state.
setBuild(array $build)
Set the render array.