in Multi Module MVC Application, I register eventsManager as registerServices:
public function registerServices(\Phalcon\DiInterface $di){
$di->get("dispatcher")->setDefaultNamespace("Modules\Admin\Controllers");
$di->get("dispatcher")->setEventsManager($di->get("eventsManager"));
$di->get("eventsManager")->attach("dispatch:beforeExecuteRoute", function($e, $d){
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxx";
});
.....
}
But it can not work, who can help me ? thank you .