Factory method for building controllers for request.
Cake\Core\ContainerInterfaceCake\Controller\ControllerConstructor
Coerces string argument to primitive type.
Create a controller for a given request.
Get the arguments for the controller action invocation.
Determine the controller class name based on current request and controller param
Invoke the action.
Invoke a controller's action and wrapping methods.
Throws an exception when a controller is missing.
__construct(Cake\Core\ContainerInterface $container)
Constructor
Cake\Core\ContainerInterface $container The container to build controllers with.
coerceStringToType(string $argument, ReflectionNamedType $type): array|string|float|int|bool|null
Coerces string argument to primitive type.
string $argument Argument to coerce
ReflectionNamedType $type Parameter type
array|string|float|int|bool|nullcreate(Psr\Http\Message\ServerRequestInterface $request): Cake\Controller\Controller
Create a controller for a given request.
Psr\Http\Message\ServerRequestInterface $request The request to build a controller for.
Cake\Controller\ControllerCake\Http\Exception\MissingControllerExceptiongetActionArgs(Closure $action, array $passedParams): array
Get the arguments for the controller action invocation.
Closure $action Controller action.
array $passedParams Params passed by the router.
arraygetControllerClass(Cake\Http\ServerRequest $request): string|null
Determine the controller class name based on current request and controller param
Cake\Http\ServerRequest $request The request to build a controller for.
string|nullhandle(ServerRequestInterface $request): Psr\Http\Message\ResponseInterface
Invoke the action.
May call other collaborating code to generate the response.
ServerRequestInterface $request Request instance.
Psr\Http\Message\ResponseInterfaceinvoke(mixed $controller): Psr\Http\Message\ResponseInterface
Invoke a controller's action and wrapping methods.
mixed $controller The controller to invoke.
Psr\Http\Message\ResponseInterfaceCake\Controller\Exception\MissingActionExceptionUnexpectedValueExceptionmissingController(Cake\Http\ServerRequest $request): Cake\Http\Exception\MissingControllerException
Throws an exception when a controller is missing.
Cake\Http\ServerRequest $request The request.
Cake\Http\Exception\MissingControllerExceptionCake\Core\ContainerInterfaceCake\Controller\Controller
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.4/class-Cake.Controller.ControllerFactory.html