Skip to content

ViewFactory

ViewFactory: creates and initializes a view using ImmutableViewInitContext.

Thin wrapper to allow future injection of decorators, instrumentation, or pooling.

class ViewFactory

SourceExecution/ViewFactory.php

public function __construct(Controller $controller): mixed

ParameterTypeDescription
$controllerController

Returns mixed

MethodDescription
create(string $viewModule, string $viewName, string $actionModule, string $actionName, string $outputType, ?WebRequest $request, array<string, mixed> $actionAttributeSnapshot, ?ValidationManager $validationManager = null): ?ViewCreate and initialize a view.

public function create(string $viewModule, string $viewName, string $actionModule, string $actionName, string $outputType, ?WebRequest $request, array<string, mixed> $actionAttributeSnapshot, ?ValidationManager $validationManager = null): ?View

Create and initialize a view.

Attributes snapshot from action exec

ParameterTypeDescription
$viewModulestringResolved module for the view
$viewNamestringCanonical view name
$actionModulestringOriginal action module
$actionNamestringOriginal action name
$outputTypestringOutput type name (lowercase)
$request?WebRequestRequest data snapshot
$actionAttributeSnapshotarray``<``string``, ``mixed``>Attributes snapshot from action exec
$validationManager?ValidationManager

Returns ?View