The Zend_Layout functionality lends itself to groups of actions that return a fragment of html which is then incorporated into a whole page with the layout. However, if I write an action that generates my nav menu, for example, I might not want this to be addressable by users (ie I don't want them to be able to visit
http://example.com/nav/display).
I think that what this boils down to is that I need, within my ActionController's action methods, to be able to determine whether or not the current controller is the first action to be activated. So, if I go to
http://example.com/myaction, myactionController::index will be called, add a bunch of actions to the actionstack helper and then each of these, as they execute, will perform a check to ensure that they are not the initial action (and redirect to index if they are).
Hope that makes sense. Is there a standard way to do this? It's entirely possible that it's something really obvious that I've missed.
Thanks.