Is there a smarter way than exploding the namespace to retrieve the currently active module in an environment which uses :module/:controller:?
You can access the router to get the module that was routed:
$module = $this->router->getModuleName();
Thanks!
Hi, Please help me: How to getting module name in a class custom helper. I tried the code below but failed:
$router = $this->getDI()->get('router'); echo $router->getModuleName()