Skip to content

SlotContent

Immutable value object representing rendered slot content plus metadata.

It intentionally carries only the data needed by template layers and renderers, not a full execution lifecycle.

final readonly class SlotContent implements SlotRenderable, Stringable

ImplementsSlotRenderable, Stringable
SourceExecution/SlotContent.php

public function __construct(string $module, string $action, ?string $outputType, string $content, array<string, mixed> $arguments = []): mixed

ParameterTypeDescription
$modulestring
$actionstring
$outputType?``string
$contentstring
$argumentsarray``<``string``, ``mixed``>

Returns mixed

MethodDescription
__toString(): string
getAction(): stringReturns the name of the slot action that produced this content.
getArguments(): array<string, mixed>
getContent(): stringReturn the already rendered slot content.
getModule(): stringReturns the module the slot action was dispatched from.
getOutputType(): ?stringReturns the output type the slot was rendered for, or null when the caller did not pin one.
toArray(): array{module: string, action: string, output_type: ?string, arguments: array<string, mixed>, content_length: int}

public function __toString(): string

Returns string

public function getAction(): string

Returns the name of the slot action that produced this content.

Returns string

public function getArguments(): array<string, mixed>

Returns array``<``string``, ``mixed``>

public function getContent(): string

Return the already rendered slot content.

Returns string

public function getModule(): string

Returns the module the slot action was dispatched from.

Returns string

public function getOutputType(): ?string

Returns the output type the slot was rendered for, or null when the caller did not pin one.

Returns ?``string

public function toArray(): array{module: string, action: string, output_type: ?string, arguments: array<string, mixed>, content_length: int}

Returns array{module: string, action: string, output_type: ?string, arguments: array<string, mixed>, content_length: int}