The way I see it there are two broad ways (and by no means are they exclusive but combinable) to doing complex views - one is the controller approach which helpers would certainly aid. The helper system looks like a good addition to the overall environment in that respect.
At the moment myself and Chris are focusing on the View layer - bypassing the controllers altogether and using multiple Zend_View instances to keep each partial view separated (as well as it's associated filters/helpers which seems needed given the recent focus on enabling reuse via Modularisation). One of the motivations is really that Views should handle as much layout as possible without controllers being required at all - basically similar in goals to the "Use Zend_View::render()" tactic you note on your linked article. This works if you allow Views to access the Model directly - which isn't forbidden so long as you follow some basic rules (my last blog post has comments from Matthew and myself which mention those more clearly than the blog post does) which are enforced usually by setting up View Helpers to mediate between View and Model. I guess complex views are just that - complex. Any solution I decide to blog about can likely be replicated using different tactics for similar results. Probably not a bad thing since each has its advantages over others and just having one method takes those advantages away from you when they're needed. I'm mainly happy it's dragged up the approaches mentioned so far since it's been helpful to see how others are getting there. >p.s. I immediately lifted the idea, from your examples, of having a >bootstrap.php file in your applications directory and index.php >pointing to it. I always felt that all the bootstrap stuff in >index.php seemed a bit incomplete or ...erh lonely perhaps? Much I'd love to take credit someone mentioned a few days ago by email that there's a ZF Demo tutorial being drafted on the developer's wiki which does something similar. So someone else beat me to it ;). Don't have the link off-hand but I think it's publically accessible. Paddy Pádraic Brady http://blog.astrumfutura.com http://www.patternsforphp.com ----- Original Message ---- From: Nick Lo <[EMAIL PROTECTED]> To: Zend Framework <[email protected]> Sent: Tuesday, April 24, 2007 12:09:01 PM Subject: Re: [fw-general] Implementing complex Views with ZF Hi Pádraic, On the feedback note. I've been following your complex views blog posts and wondered if you'd looked at Ralph Schindler's Action Helpers in the incubator? My so far so good solution to the whole composite views issue has been to have all controllers extend a main controller (or two) and that controller would have the "layout" type stuff. The layout view script is then something like I described here (albeit updated)... http://www.ingredients.com.au/nick/2006/06/10/getting-to-know-zend_view/ The action helpers however have the potential to contribute a much needed element to the control of more complex views. Nick p.s. I immediately lifted the idea, from your examples, of having a bootstrap.php file in your applications directory and index.php pointing to it. I always felt that all the bootstrap stuff in index.php seemed a bit incomplete or ...erh lonely perhaps? > Feedback makes the open source world go round ;). > > The HTML looks cleaner now. I'm still seeing quirks mode (missing > Doctype) but I understand this isn't a massive concern so early on > in the example. Your approach is working quite well as far as I can > see. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
