Sets a number of properties based on conventions if they are empty. To override the
conventions CakePHP uses you can define properties in your class declaration.
public __construct ( Cake\Network\Request $request = null, |
||
$request | Cake\Network\Request | Request object for this controller. Can be null for testing, but expect that features that use the request parameters will not work. |
$response | Response object for this controller. | |
$name | string | null | Override the name useful in testing when using mocks. |
$eventManager | Cake\Event\EventManager | null | The event manager. Defaults to a new instance. |
$components | Cake\Controller\ComponentRegistry | null | The component registry. Defaults to a new instance. |
public function __construct($request = null, $response = null) { $request->webroot = '/'; Router::setRequestInfo($request); parent::__construct($request, $response); }
/** * Make it possible to dynamically define the components array during tests * * @param CakeRequest $request * @param CakeResponse $response * @return void */ public function __construct($request = null, $response = null) { $this->components = self::$componentsArray; return parent::__construct($request, $response); }
public function __construct(\Cake\Network\Request $request = null, \Cake\Network\Response $response = null, $name = null, $eventManager = null, $components = null) { parent::__construct($request, $response, $name, $eventManager, $components); $this->set('bt_consultar_acao', true); $this->set('bt_cadastrar_acao', true); $this->set('bt_excluir_acao', true); }
/** * construct method */ public function __construct($request = null, $response = null) { $request->addParams(Router::parse('/auth_test')); $request->here = '/auth_test'; $request->webroot = '/'; Router::setRequestInfo($request); parent::__construct($request, $response); }
/** * Constructor. * * @param \Cake\Network\Request $request Request object for this controller. * Can be null for testing, but expect that features that use the request * parameters will not work. * @param \Cake\Network\Response $response Response object for this controller. */ public function __construct($request = null, $response = null) { parent::__construct($request, $response); $location = $this->response->location(); $this->viewBuilder()->className('CMS\\View\\View'); if (empty($location)) { $this->viewMode('default'); $this->prepareTheme(); $this->checkMaintenanceMode(); } $this->response->header('Content-Language', language('code')); $this->response->header('X-Generator', sprintf('QuickAppsCMS %s (http://quickappscms.org)', quickapps('version'))); }
/** * Constructor * * @param \Cake\Network\Request $request Request instance. * @param \Cake\Network\Response $response Reponse instance. */ public function __construct($request = null, $response = null) { parent::__construct($request, $response); if (count(Router::extensions()) && !isset($this->RequestHandler)) { $this->loadComponent('RequestHandler'); } $eventManager = $this->eventManager(); if (isset($this->Auth)) { $eventManager->detach($this->Auth); } if (isset($this->Security)) { $eventManager->detach($this->Security); } $this->cacheAction = false; $this->viewPath = 'Error'; }
/** * Call the parent (original) constructor. * * @param Request|null $request * @param Response|null $response * @param null $name * @param null $eventManager * @param null $components */ public function construct(Request $request = null, Response $response = null, $name = null, $eventManager = null, $components = null) { parent::__construct($request, $response, $name, $eventManager, $components); }
/** * Constructor * * @param \Cake\Network\Request|null $request Request instance. * @param \Cake\Network\Response|null $response Response instance. */ public function __construct($request = null, $response = null) { parent::__construct($request, $response); if (count(Router::extensions()) && !isset($this->RequestHandler)) { $this->loadComponent('RequestHandler'); } $eventManager = $this->eventManager(); if (isset($this->Auth)) { $eventManager->off($this->Auth); } if (isset($this->Security)) { $eventManager->off($this->Security); } }
public function __construct($request, $response = null) { parent::__construct($request, $response); $this->viewClass = '\\App\\View\\PhpView'; }
/** * Construct running after initialize * @param Request|null $request * @param Response|null $response * @param null $name * @param null $eventManager */ public function __construct(Request $request = null, Response $response = null, $name = null, $eventManager = null) { parent::__construct($request, $response, $name, $eventManager); Hook::applyHookMethods('Hook.controller_methods', $this); /** This below event trigger After "SpiderController.afterInitialize" event.*/ $this->eventManager()->dispatch(new Event('SpiderController.afterConstruct', $this)); }