Zend_navigation and modules

I am developing the application at the moment using zend, and I have separated the application from the modules.

The default module is the main site where users are unavailable and free to view. When you log in, depending on the type of user, you either go to module A or module B, which is managed by simple ACLs. If you have access to module A, you cannot access module B and vice versa. Both types of user can see the default module.

Now I want to use Zend_Navigation to control the navigation of all applications in all modules. I am not sure how to do this, since all the examples that I saw work in a module or a very simple application.

I am trying to make my navigation.xml file look like this:

<configdata> <navigation> <label>Home</label> <controller>index</controller> <action>index</action> <module>default</module> <pages> <tour> <label>tour</label> <controller>tour</controller> <action>index</action> <module>default</module> </tour> <blog> <label>blog</label> <url>http://blog.mysite.com</url> </blog> <support> <label>Support</label> <controller>support</controller> <action>index</action> <module>default</module> </support> </pages> </navigation> </configdata> 

This is fine for the default module, but how can I use other modules on this navigation page? Each module has its own homepage, others, etc.

Would it be better to add a unique navigation.xml file for each module that loads into the preDispatch plugin that I wrote to handle my ACLs? Or save them in one massive navigation file?

Any advice would be fantastic.

Thanks,

Grant

+3
source share
1 answer

Grant,

Usually I create a config directory under each module, and there I put the navigation.xml document. This helps reduce cross-dependency issues.

0
source

Source: https://habr.com/ru/post/1305842/


All Articles