Factory method for building controllers for request.
Cake\Core\ContainerInterface
Cake\Controller\Controller
Constructor
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|null
create(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\Controller
Cake\Http\Exception\MissingControllerException
getActionArgs(Closure $action, array $passedParams): array
Get the arguments for the controller action invocation.
Closure
$action Controller action.
array
$passedParams Params passed by the router.
array
getControllerClass(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|null
handle(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\ResponseInterface
invoke(mixed $controller): Psr\Http\Message\ResponseInterface
Invoke a controller's action and wrapping methods.
mixed
$controller The controller to invoke.
Psr\Http\Message\ResponseInterface
Cake\Controller\Exception\MissingActionException
UnexpectedValueException
missingController(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\MissingControllerException
Cake\Core\ContainerInterface
Cake\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