public function initDispatcher()
    {
        $this->di->set('dispatcher', function() {
            $dispatcher = new Dispatcher();

            /**
             * @var \Phalcon\Events\Manager $eventsManager
             */
            $eventsManager = $this->di->getShared('eventsManager');
            $eventsManager->attach(
                'dispatch:beforeException',
                (new ExceptionListener())->beforeException()
            );

            $dispatcher->setEventsManager($eventsManager);

            return $dispatcher;
        });
    }
public function initDispatcher()
    {
        $this->di->set('dispatcher', function() {
            $dispatcher = new Dispatcher();

            /**
             * @var \Phalcon\Events\Manager $eventsManager
             */
            $eventsManager = $this->di->getShared('eventsManager');
            $eventsManager->attach(
                'dispatch:beforeException',
                (new ExceptionListener())->beforeException()
            );

            $dispatcher->setEventsManager($eventsManager);

            return $dispatcher;
        });
    }
public function initDispatcher ( ) { $ this -> di -> set ( 'dispatcher' , function ( ) { $ dispatcher = new Dispatcher ( ) ; /**
             * @var \Phalcon\Events\Manager $eventsManager
             */ $ eventsManager = $ this -> di -> getShared ( 'eventsManager' ) ; $ eventsManager -> attach ( 'dispatch:beforeException' , ( new ExceptionListener ( ) ) -> beforeException ( ) ) ; $ dispatcher -> setEventsManager ( $ eventsManager ) ; return $ dispatcher ; } ) ; }
Registers default dispatcher
Registers default dispatcher