SlotDispatcher
Dynamic optional action extension points used via method_exists():
Synopsis
Section titled “Synopsis”class SlotDispatcher
| Source | Execution/SlotDispatcher.php |
Constants
Section titled “Constants”| Constant | Value | Description |
|---|---|---|
RECURSION_LIMIT | 10 |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”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
| Parameter | Type | Description |
|---|---|---|
$controller | Controller | |
$actionResolver | ?ActionResolver | |
$executionGuard | ?SlotExecutionGuard | |
$viewNameResolver | ?ViewNameResolver | |
$forwardService | ?ForwardService | |
$viewFactory | ?ViewFactory | |
$clock | ?ClockInterface | |
$environment | ?EnvironmentReaderInterface |
Returns mixed
Methods
Section titled “Methods”dispatch()
Section titled “dispatch()”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.
| Parameter | Type | Description |
|---|---|---|
$parentRequest | ServerRequestInterface | The parent PSR request containing SlotStack attribute. |
$module | string | Module name. |
$action | string | Action name. |
$parameters | array``<``string``, ``mixed``> | Optional associative array of request parameters for the slot. |
$outputType | ?``string | Optional output type override. |
Returns string
dispatchSlotContent()
Section titled “dispatchSlotContent()”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.
| Parameter | Type | Description |
|---|---|---|
$parentRequest | ServerRequestInterface | |
$module | string | |
$action | string | |
$parameters | array``<``string``, ``mixed``> | |
$outputType | ?``string |
Returns SlotContent
dispatchSlotContext()
Section titled “dispatchSlotContext()”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.
| Parameter | Type | Description |
|---|---|---|
$parentRequest | ServerRequestInterface | |
$module | string | |
$action | string | |
$parameters | array``<``string``, ``mixed``> | |
$outputType | ?``string |
Returns SlotExecutionContext
dispatchWithContext()
Section titled “dispatchWithContext()”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.
| Parameter | Type | Description |
|---|---|---|
$parentRequest | ServerRequestInterface | |
$module | string | |
$action | string | |
$parameters | array``<``string``, ``mixed``> | |
$outputType | ?``string |
Returns ActionExecutionContext