We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

get module name

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



77.6k
Accepted
answer

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

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



5.6k

tnx a lot



5.6k
edited Sep '15

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