I am creating a display object library for our application. They display html of a large number of common objects (users, conversations, messages, etc.) in different views. By ideas, I mean that an object can drop different "zoom levels" with different markups.
Some display objects contain other display objects for rendering, for example. the user list object displays user objects in a specific form (this particular view returns them back to the list items so that they fit into the list)
I am trying to move them into the correct way to do something in ZF, but I cannot decide if they should all be viewers or all scripts / partial views.
Just forcing them to look at the scripts and rendering them using β render () seems a little dirty because any information or parameters that I want to pass to them must be assigned to the view object.
Particles seem a little more correct, except that they are not sure that their implementation of the display logic in them is correct (if "showNotificationStatus" is passed as a parameter, draw this range). Or, if its kosher for partial displays other partial (a list of users representing the user object).
Looking at helpers seems like the right way to do this, but I don't know if this is abusing view helpers. Each object can be a view helper and take an objectview parameter so that it knows what zoom level / container to display itself, or each object can even be its own assistant (therefore there is no big switch statement inside the object). One nice thing about views is that you can pass parameters, and it still has access to the view context if you need something from this level.
Most of them are going to accept models, and some require some additional parameters in order to know what to do (for example, showNotificationStatus on top). What is the right tool for this?
php zend-framework
Bob spryn
source share