I'm building a web application/ framework and I'm trying to implement
blocks/panels (boxes on the right hand side, essentially, choose your own
terminology).

It's not necessarily that hard from a technical point-of-view (bar one thing
that I'm not quite sure how to do), but what I'm looking for is a
consistent, logical approach - any ideas would be appreciated.

My approach so far has been as follows;
- I'm using the placeHolder helper to inject the boxes into the layout
- I've got a "box" view script to render the box, with the title, css class
and content as member variables
- I have a Controller helper to render a box, which essentially creates an
instance of the Box view script, injects the parameters and prepends /
appends the result to the appropriate placeholder

Some of the boxes are common to all/most pages, so I'm performing this in a
Controller plugin.

What would be most useful, however, is to create boxes using actions
attached to the various modules and controllers.  E.g., a list of online
users would be best created by the User controller, but inserted into the
page using a Controller plugin (e.g. in a postDispatch method).  Also, by
creating a box using a Controller/Action, I'd be making it easy to switch my
application to rendering boxes using an AJAX call.  What would be the best
way to do this?  Is there an easy and logical way of, say, firing off a call
to /user/online and injecting the result into a method within a Controller
plugin?

I'd imagine many people have thought about this, so I'd be interested to get
a discussion going about peoples' approaches.

Thanks
-- 
View this message in context: 
http://www.nabble.com/Strategy-for-%22panels%22---%22blocks%22-tp20758783p20758783.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to