當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DI::__construct方法代碼示例

本文整理匯總了PHP中Phalcon\DI::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP DI::__construct方法的具體用法?PHP DI::__construct怎麽用?PHP DI::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Phalcon\DI的用法示例。


在下文中一共展示了DI::__construct方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * \Phalcon\DI\FactoryDefault constructor
  */
 public function __construct()
 {
     parent::__construct();
     $services = array();
     /* Base */
     $services['router'] = new Service('router', 'Phalcon\\Mvc\\Router', true);
     $services['dispatcher'] = new Service('dispatcher', 'Phalcon\\Mvc\\Dispatcher', true);
     $services['url'] = new Service('url', 'Phalcon\\Mvc\\Url', true);
     /* Models */
     $services['modelsManager'] = new Service('modelsManager', 'Phalcon\\Mvc\\Model\\Manager', true);
     $services['modelsMetadata'] = new Service('modelsMetadata', 'Phalcon\\Mvc\\Model\\MetaData\\Memory', true);
     /* Request/Response */
     $services['response'] = new Service('response', 'Phalcon\\Http\\Response', true);
     $services['cookies'] = new Service('cookies', 'Phalcon\\Http\\Response\\Cookies', true);
     $services['request'] = new Service('request', 'Phalcon\\Http\\Request', true);
     /* Filter/Escaper */
     $services['filter'] = new Service('filter', 'Phalcon\\Filter', true);
     $services['escaper'] = new Service('escaper', 'Phalcon\\Escaper', true);
     /* Annotations */
     $services['annotations'] = new Service('annotations', 'Phalcon\\Annotations\\Adapter\\Memory', true);
     /* Security */
     $services['security'] = new Service('security', 'Phalcon\\Security', true);
     $services['crypt'] = new Service('crypt', 'Phalcon\\Crypt', true);
     /* Flash */
     $services['flash'] = new Service('flash', 'Phalcon\\Flash\\Direct', true);
     $services['flashSession'] = new Service('flashSession', 'Phalcon\\Flash\\Session', true);
     /* Tag/Helpers */
     $services['tag'] = new Service('tag', 'Phalcon\\Tag', true);
     /* Session */
     $services['session'] = new Service('session', 'Phalcon\\Session\\Adapter\\Files', true);
     $services['sessionBag'] = new Service('sessionBag', 'Phalcon\\Session\\Bag', true);
     /* Managers */
     $services['eventsManager'] = new Service('eventsManager', 'Phalcon\\Events\\Manager', true);
     $services['transactions'] = new Service('transactions', 'Phalcon\\Mvc\\Model\\Transaction\\Manager', true);
     $services['assets'] = new Service('assets', 'Phalcon\\Assets\\Manager', true);
     //Update the internal services property
     $this->_services = $services;
 }
開發者ID:aisuhua,項目名稱:phalcon-php,代碼行數:41,代碼來源:FactoryDefault.php


注:本文中的Phalcon\DI::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。