当前位置: 首页>>代码示例>>PHP>>正文


PHP Controller::__construct方法代码示例

本文整理汇总了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);
 }
开发者ID:arourke,项目名称:UserPermissions,代码行数:6,代码来源:UserPermissionComponentTest.php

示例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);
 }
开发者ID:lucasnpinheiro,项目名称:Kiterp,代码行数:7,代码来源:AppController.php

示例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);
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:11,代码来源:AuthTestController.php

示例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')));
 }
开发者ID:quickapps-plugins,项目名称:cms,代码行数:21,代码来源:Controller.php

示例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';
 }
开发者ID:maitrepylos,项目名称:nazeweb,代码行数:22,代码来源:ErrorController.php

示例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);
 }
开发者ID:kristiyandobrev,项目名称:crud,代码行数:12,代码来源:CrudComponentTest.php

示例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);
 }
开发者ID:eryw,项目名称:pastry-bag,代码行数:13,代码来源:Controller.php

示例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);
     }
 }
开发者ID:CakeDC,项目名称:cakephp,代码行数:20,代码来源:ErrorController.php

示例9: __construct

 public function __construct($request, $response = null)
 {
     parent::__construct($request, $response);
     $this->viewClass = '\\App\\View\\PhpView';
 }
开发者ID:wafflestealer654,项目名称:computer-repair-website,代码行数:5,代码来源:AppController.php

示例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));
 }
开发者ID:mohammadsaleh,项目名称:spider,代码行数:14,代码来源:SpiderController.php


注:本文中的Cake\Controller\Controller::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。