Have just finished tutorial by Rob Allen:
http://akrabat.com/wp-content/uploads/Getting-Started-with-Zend-Framework-2.pdf
then i decided to get module name in view, to make menu between application module & albums module, as i see could implement this, i was able to get module name.
How can i get in layout when any module is requested? (this menu is global).
I am very new to the ZF2, and i understand that i misunderstanding the concept, but can’t understand where 🙂
Any help will be useful. Thanks in advance.
Module names are tricky as there isn’t actually the concept of a module in the dispatcher.
You would have to put it into the layout yourself. The easiest way to do this is from the controller:
Ideally, you should not need to know this information and work entirely with route names.