当前位置: 首页>>代码示例>>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;未经允许,请勿转载。