-- Pádraic Brady <[EMAIL PROTECTED]> wrote
(on Tuesday, 11 September 2007, 03:32 PM -0700):
> > At first I was skeptical of Padriac Brady's talk of the controller-
> > centricity of ZF, but I think he's onto something. Why shouldn't you
> > be able to override the default layout from within a view script on
> > a  case by case basis? [By calling
> > $this->setLayout('non-default.phtml')  from a view.] Maybe I should
> > be looking at implementing a full  composite view or something if
> > this sort of use case falls outside  80/20.
> 
> Zend_Layout will offer a controller oriented take on Composite Views
> (using sub-Requests) - 

Not entirely true. If you look at the current proposal state, you'll see
that in the current incarnation it does not require the controllers at
all. If used with them, however, it registers a plugin with the front
controller that will render the layout during dispatchLoopShutdown().
This plugin will pull any named response segments and inject them into
the layout view, but you can assign layout variables from anywhere.

Yes, it *can* use sub-requests, but they're not a necessary part of
the implementation, just a convenience.

> granted I don't agree with that interpretation since it's outside the
> normal practice in my experience (being a J2EE developer with a strong
> preference for View Helpers) as something of a performance/bloat risk
> - but it's wholly valid and should be sufficient for most cases. If
> the shoe doesn't fit it's pretty easy to tackle a J2EE style Composite
> View approach with a Zend_View subclass, and almost as easy to
> integrate this as custom Smarty tags (as one would under JSP anyway if
> Tiles were missing). Most of the supporting pieces outside ZVE Layouts
> will be available as standard afterall - Partials/Placeholders etc.
> View Helpers reading from a Model don't even require any ZF support so
> nothing has changed there either.

Definitely -- the only part of ZVE under question right now is the
controller helper, and primarily because I'm not sure how to handle
forward/redirect events controllers dispatched by such a helper.

> Matthew's improvements will keep the 80/20 more than satisfied ;).

You're too kind -- you and Ralph have done most of the work. ;-)


> ----- Original Message ----
> From: Nathan Wright <[EMAIL PROTECTED]>
> To: Matthew Weier O'Phinney <[EMAIL PROTECTED]>
> Cc: Zend Framework General <[email protected]>
> Sent: Tuesday, September 11, 2007 10:20:02 PM
> Subject: Re: [fw-general] Zend_Layout Status ?
> 
> Will layouts still render when ViewRenderer::setNoRender(true) has  
> been called? That's one of the things I like about the ZVE approach--
> you don't have to manipulate two helpers every time you want to  
> disable view rendering.
> 
> Will Zend_Layout be limited to 1 layout per request?
> 
> At first I was skeptical of Padriac Brady's talk of the controller-
> centricity of ZF, but I think he's onto something. Why shouldn't you  
> be able to override the default layout from within a view script on a  
> case by case basis? [By calling $this->setLayout('non-default.phtml')  
> from a view.] Maybe I should be looking at implementing a full  
> composite view or something if this sort of use case falls outside  
> 80/20.
> 
> Cheers,
> ncw
> 
> On 11-Sep-07, at 12:35 PM, Matthew Weier O'Phinney wrote:
> 
> > -- Philip G <[EMAIL PROTECTED]> wrote
> > (on Tuesday, 11 September 2007, 02:25 PM -0500):
> >> On 8/18/07, Matthew Weier O'Phinney <[EMAIL PROTECTED]> wrote:
> >>
> >>     -- PotatoBob <[EMAIL PROTECTED]> wrote
> >>     (on Friday, 17 August 2007, 11:33 PM -0700):
> >>>
> >>> I sure hope default module layouts and a setConfig() feature are  
> >>> added to
> >>> zend_layout :(
> >>
> >>     Ralph and I were discussing Zend_Layout yesterday. The current  
> >> design
> >>     we're looking at would have a default layout, and allow  
> >> specifying the
> >>     layout to use either via a setLayout() accessor or as an  
> >> argument to a
> >>     render() method.
> >>
> >>
> >>
> >> Just jumping in to put my two cents in -- this is exactly what I'm
> >> looking for (setLayout() option). I originally built a layout  
> >> support,
> >> of this exact same model, on top of Zend_View in ZF ~0.6. In my
> >> research  to figure out Zend_View changes, I ran across this post.  
> >> I'm
> >> still figuring out what changed in Zend_View, but this is what I'm
> >> looking for. I'm actually rather shocked this option wasn't added  
> >> with
> >> 1.0.
> >
> > To be clear, setLayout() will be part of a separate class,  
> > Zend_Layout.
> > Zend_View will not have any concept of layouts by itself.
> >
> > Layouts as created in most frameworks are simply views with  
> > placeholders
> > for content -- in other words, a decorator for an application view.
> > Zend_Layout will operate in a similar fashion, and register a plugin
> > with dispatchLoopShutdown() to perform its work.
> >
> > Layout support was not done for 1.0.0 as we'd only just finalized  
> > things
> > like integrated view support for controllers (via the ViewRenderer),
> > and action helpers -- the building blocks on which a layout solution
> > will be based.
> >
> > --
> > Matthew Weier O'Phinney
> > PHP Developer            | [EMAIL PROTECTED]
> > Zend - The PHP Company   | http://www.zend.com/
> 
> 
> 
> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
> Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get listings,
> and more!

-- 
Matthew Weier O'Phinney
PHP Developer            | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to