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?