I'm creating a dynamic Application in which the content is added through a CMS. Inside the CMS, I'm setting a db entry which states what module to use for each content page.
NodeId, ParentNodeId, Name_de, Name_en, ModuleName, foreignkey_ContentLinks,
in this table entries look as follows: 6, 1, Veranstaltung-21-02-2013, Event-21-02-2013, Events, 682
The entire tree should end up in my navigation (and perfectly also in my routing). I do not want to add it in some controller, because my Application consists of a whole bunch of Modules and I want to access that Info across all my Modules.
I already tried injecting it in the global.php, but to no avail because I can't my db adapter or any other important classes at that stage.
Any ideas or links to best practices?
The navigation containers are composed by factory classes. The easiest approach is to write your own factory and have the
getPages()method fetch pages from a database instead of from config. If you extend from the AbstractNavigationFactory you only need to write a couple of methods.Add the factory to the service manager, just like you would for other containers
And use it with the navigation view helpers in the same way