本文整理汇总了PHP中Cake\Controller\Controller::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Controller::__construct方法的具体用法?PHP Controller::__construct怎么用?PHP Controller::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\Controller\Controller
的用法示例。
在下文中一共展示了Controller::__construct方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($request = null, $response = null)
{
$request->webroot = '/';
Router::setRequestInfo($request);
parent::__construct($request, $response);
}
示例2: __construct
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);
}
示例3: __construct
/**
* 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);
}
示例4: __construct
/**
* 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')));
}
示例5: __construct
/**
* 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';
}
示例6: __construct
/**
* 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);
}
示例7: construct
/**
* 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);
}
示例8: __construct
/**
* 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);
}
}
示例9: __construct
public function __construct($request, $response = null)
{
parent::__construct($request, $response);
$this->viewClass = '\\App\\View\\PhpView';
}
示例10: __construct
/**
* 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));
}