We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

dispatcher event at Module registerServices

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 .

What you mean it can not work? What you want to achieve? IS dispatcher shared service?