Fr3nch13/CakePHP Utilities

ControllerFactory
in package
implements ControllerFactoryInterface, RequestHandlerInterface

Factory method for building controllers for request.

Tags
implements

\Cake\Http\ControllerFactoryInterface<\Cake\Controller\Controller>

Table of Contents

Interfaces

ControllerFactoryInterface
Factory method for building controllers from request/response pairs.
RequestHandlerInterface
Handles a server request and produces a response.

Properties

$container  : ContainerInterface
$controller  : Controller

Methods

__construct()  : mixed
Constructor
create()  : Controller
Create a controller for a given request.
getControllerClass()  : string|null
Determine the controller class name based on current request and controller param
handle()  : ResponseInterface
Invoke the action.
invoke()  : ResponseInterface
Invoke a controller's action and wrapping methods.
coerceStringToType()  : array<string|int, mixed>|string|float|int|bool|null
Coerces string argument to primitive type.
getActionArgs()  : array<string|int, mixed>
Get the arguments for the controller action invocation.
missingController()  : MissingControllerException
Throws an exception when a controller is missing.

Properties

Methods

getControllerClass()

Determine the controller class name based on current request and controller param

public getControllerClass(ServerRequest $request) : string|null
Parameters
$request : ServerRequest

The request to build a controller for.

Tags
psalm-return

class-string<\Cake\Controller\Controller>|null

Return values
string|null

coerceStringToType()

Coerces string argument to primitive type.

protected coerceStringToType(string $argument, ReflectionNamedType $type) : array<string|int, mixed>|string|float|int|bool|null
Parameters
$argument : string

Argument to coerce

$type : ReflectionNamedType

Parameter type

Return values
array<string|int, mixed>|string|float|int|bool|null

getActionArgs()

Get the arguments for the controller action invocation.

protected getActionArgs(Closure $action, array<string|int, mixed> $passedParams) : array<string|int, mixed>
Parameters
$action : Closure

Controller action.

$passedParams : array<string|int, mixed>

Params passed by the router.

Return values
array<string|int, mixed>

        
On this page

Search results