I currently initialize my web site navigation during bootstrap. I initialize anywhere from 1 to 3 navigation objects. Most requests will need the Navigation objects, but some don't. The ones that don't include files generated for download and JSON requests. I don't want to do the work of generating the navigation objects when they aren't going to be used.
I see two different possible solution types:
For an acceptable solution I am looking for specifics in solving this problem. I am interested in solution types that I haven't listed as well.
SOLUTION
I am accepting FinalForm's answer, but it did not have the specifics that I was looking for. Here are the steps I took:
Navigation
database model class for each navigation objectNavigation
model to Zend_Registry
in the BootstrapView
references like $this->siteNav
to Zend_Registry::get('nav')->getSiteNav()
Lazy Load all the way dude.
Initializing navigation at boot strap seems like added overhead to the entire application as not every page needs navigation.
mucking with Specify routes that don't need the navigation
sounds clugey.
You should extend the Zend Libraries to create your own sorta version library, e.g. extend the core controller. In that extension use that to add a method to build your navigation. In other words subclass your actual application from the extended library classes.
Or create custom view helpers
to develop your navigation.