phalcon plugins for phalcon-framwork

Maintainers

Package info

github.com/zhaoyang1214/phalcon-framwork-plugins

Type:phalcon-plugins

pkg:composer/phalcon-framwork/plugins

Statistics

Installs: 60

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v1.1.2 2019-08-03 14:50 UTC

This package is auto-updated.

Last update: 2026-03-01 00:12:29 UTC


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;
});