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

get module name

How can I get module name in application:afterStartModule event ?



77.7k
Accepted
answer

The event will recieve two params: $application, $moduleInterface

You should be able to use $application->dispatcher->getModuleName(); or $application->router->getModuleName();



5.7k

tnx a lot



5.7k
edited Sep '15

but $application->dispatcher->getModuleName() return empty, the second one return true!