Skip to content

SlotDispatcher

Dynamic optional action extension points used via method_exists():

class SlotDispatcher

SourceExecution/SlotDispatcher.php
ConstantValueDescription
RECURSION_LIMIT10

public function __construct(Controller $controller, ?ActionResolver $actionResolver = null, ?SlotExecutionGuard $executionGuard = null, ?ViewNameResolver $viewNameResolver = null, ?ForwardService $forwardService = null, ?ViewFactory $viewFactory = null, ?ClockInterface $clock = null, ?EnvironmentReaderInterface $environment = null): mixed

ParameterTypeDescription
$controllerController
$actionResolver?ActionResolver
$executionGuard?SlotExecutionGuard
$viewNameResolver?ViewNameResolver
$forwardService?ForwardService
$viewFactory?ViewFactory
$clock?ClockInterface
$environment?EnvironmentReaderInterface

Returns mixed

MethodDescription
dispatch(ServerRequestInterface $parentRequest, string $module, string $action, array<string, mixed> $parameters = [], ?string $outputType = null): stringDispatch a slot (sub-action) and return its response content.
dispatchSlotContent(ServerRequestInterface $parentRequest, string $module, string $action, array<string, mixed> $parameters = [], ?string $outputType = null): SlotContentNew API: dispatch and return SlotContent value object instead of raw string.
dispatchSlotContext(ServerRequestInterface $parentRequest, string $module, string $action, array<string, mixed> $parameters = [], ?string $outputType = null): SlotExecutionContextExperimental: dispatch slot and return SlotExecutionContext (immutable) for richer metadata.
dispatchWithContext(ServerRequestInterface $parentRequest, string $module, string $action, array<string, mixed> $parameters = [], ?string $outputType = null): ActionExecutionContextExperimental API: identical to dispatch() but returns ActionExecutionContext alongside content.

public function dispatch(ServerRequestInterface $parentRequest, string $module, string $action, array<string, mixed> $parameters = [], ?string $outputType = null): string

Dispatch a slot (sub-action) and return its response content.

Optional output type override.

ParameterTypeDescription
$parentRequestServerRequestInterfaceThe parent PSR request containing SlotStack attribute.
$modulestringModule name.
$actionstringAction name.
$parametersarray``<``string``, ``mixed``>Optional associative array of request parameters for the slot.
$outputType?``stringOptional output type override.

Returns string

public function dispatchSlotContent(ServerRequestInterface $parentRequest, string $module, string $action, array<string, mixed> $parameters = [], ?string $outputType = null): SlotContent

New API: dispatch and return SlotContent value object instead of raw string.

ParameterTypeDescription
$parentRequestServerRequestInterface
$modulestring
$actionstring
$parametersarray``<``string``, ``mixed``>
$outputType?``string

Returns SlotContent

public function dispatchSlotContext(ServerRequestInterface $parentRequest, string $module, string $action, array<string, mixed> $parameters = [], ?string $outputType = null): SlotExecutionContext

Experimental: dispatch slot and return SlotExecutionContext (immutable) for richer metadata.

ParameterTypeDescription
$parentRequestServerRequestInterface
$modulestring
$actionstring
$parametersarray``<``string``, ``mixed``>
$outputType?``string

Returns SlotExecutionContext

public function dispatchWithContext(ServerRequestInterface $parentRequest, string $module, string $action, array<string, mixed> $parameters = [], ?string $outputType = null): ActionExecutionContext

Experimental API: identical to dispatch() but returns ActionExecutionContext alongside content.

ParameterTypeDescription
$parentRequestServerRequestInterface
$modulestring
$actionstring
$parametersarray``<``string``, ``mixed``>
$outputType?``string

Returns ActionExecutionContext