Class ControllerFactory

Factory method for building controllers from request/response pairs.

Namespace: Cake\Http
Location: Http/ControllerFactory.php

Method Summary

  • create() public
    Create a controller for a given request/response
  • Determine the controller class name based on current request and controller param
  • Throws an exception when a controller is missing.

Method Detail

create()source public

create( Cake\Http\ServerRequest $request , Cake\Http\Response $response )

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()source public

getControllerClass( Cake\Http\ServerRequest $request )

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()source protected

missingController( Cake\Http\ServerRequest $request )

Throws an exception when a controller is missing.

Parameters

Cake\Http\ServerRequest $request
The request.

Throws

Cake\Routing\Exception\MissingControllerException

© 2005–2017 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/3.4/class-Cake.Http.ControllerFactory.html