當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。