Class ControllerFactory
Factory method for building controllers from request/response pairs.
Namespace: Cake\Http
Method Summary
-
create() public
Create a controller for a given request/response
-
getControllerClass() public
Determine the controller class name based on current request and controller param
-
missingController() protected
Throws an exception when a controller is missing.
Method Detail
create() ¶ public
create(Cake\Http\ServerRequest $request, Cake\Http\Response $response): Cake\Controller\Controller
Create a controller for a given request/response
Parameters
-
Cake\Http\ServerRequest
$request The request to build a controller for.
-
Cake\Http\Response
$response The response to use.
Returns
Cake\Controller\Controller
getControllerClass() ¶ public
getControllerClass(Cake\Http\ServerRequest $request): string|null
Determine the controller class name based on current request and controller param
Parameters
-
Cake\Http\ServerRequest
$request The request to build a controller for.
Returns
string|null
missingController() ¶ protected
missingController(Cake\Http\ServerRequest $request): void
Throws an exception when a controller is missing.
Parameters
-
Cake\Http\ServerRequest
$request The request.
Returns
void
Throws
Cake\Routing\Exception\MissingControllerException