本文整理汇总了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;
}