Zend Framework and custom Navigation Containers
In Zend's Documentation they write about creating Navigation Containers. But they don't explain where I should create them. Does anyone know that?
I'm also wondering if a custom Navigation Container extends or overwrites the navigation.xml file which contains the stati开发者_运维技巧c links.
(I want to make a custom Navigation Container to add dynamic links from my database)
(I want to make a custom Navigation Container to add dynamic links from my database)
Create a controller plugin and initialize the containers there.
If you need, you may restrict it to run only on specific module/controller/action by creating conditions on request parameters or even switch layout if needed.
You may also create navigation container as a model, or create getNavigation()
in your existing model and use in anywhere, whenever you need it.
Another solution is to create the navigation container in the view helper on the fly.
Choose the one which works best in your case (eg. depending how do you handle cache).
精彩评论