This question is related to the question asked here, regarding the best practice for handling tabbed interfaces. It made reference to a blog post titled, Why the Zend Framework Actionstack is Evil, which outlined that you should use partials and view helpers for elements that will be reused. This is fine until the element has to handle some input, in which case view helpers are not the answer. This is where you use action helpers, Matthew Weier O'Phinney talks about a use case for this in his blog post titled, Using Action Helpers To Implement Re-Usable Widgets.
After reading these viewpoints I seem to be more confused on the best course of action for my interface. The site will consist of three major tabs, Cases, Staff, & Departments. Each of these tabs will follow a similar layout consisting of a selector/search table, a (Case|Staff|Department) summary, and then another area with vertical tab menu. The main tabs will have some vertical tab items that are identical except for the information being displayed.
The question is how do I structure the views, helpers and controllers around this interface. I was thinking of having an index, case, staff and department controller. Creating an action helper which will reuse a view for each major tab, but use the request data to determine the currently selected (Case|Staff|Department). Using the individual tab controllers to handle jQuery ajax requests for the vertical tab content and delegate the output to a view helper which will reuse a common view. And also use the individual tab controllers to handle jQuery ajax crud operations.
Is this the best way to do this, or are there better more efficient methods?
I'd create separate controllers for each of your three main tabs. The vertical tabs you describe would correspond to actions on those controllers.
For rendering all those navigation tabs - top-level and the verticals - it sounds like the answer is.... Zend_Navigation
(more info).
You can place all the structured navigation data - probably read from a INI file or from an XML file or even from a structured array - into a single Zend_Navigation
container and then render the "active" branch.