phalcon-framwork / plugins
phalcon-framwork 的插件
v1.1.2
2019-08-03 14:50 UTC
Requires
- php: >=7.0
README
在服务中使用
$di->setShared('dispatcher', function () { $dispatcherConfig = $this->getConfig()->services->dispatcher; $dispatcher = new Dispatcher(); if (isset($dispatcherConfig->module_default_namespaces)) { $dispatcher->setDefaultNamespace($dispatcherConfig->module_default_namespaces); } $eventsManager = new EventsManager(); $dispatcherPlugin = new DIspatcherPlugin($dispatcherConfig->toArray()); $eventsManager->attach('dispatch', $dispatcherPlugin); $dispatcher->setEventsManager($eventsManager); return $dispatcher; });