News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

3 Engineers Blog:
3 Step Layouts in Zend Framework
April 04, 2011 @ 13:04:06

In a recent post to the 3 Engineers blog, they take the usual "Two Step" approach the Zend Framework takes to generating view data (Zend_View + Zend_Layout) and takes it up one more step by using Three Step Layouts with a simple wrapper.

While the Two Step View pattern creates a reasonable paradigm for seperating layout presentation from page presentation, enabling Three-level Inheritance allows for even better separation. In other words, using 3 Step Layouts is a possible and often necessary investment to make when implementing front-ends in Zend Framework projects; they allow fine grain re-usability that provides for a DRYer presentation layer.

They have a three step process you can follow (complete with code snippets) that'll have you working with their 3 layers easily. The wrapper is a sort of "boostrap" for the layout. The nested layout is then pulled into this wrapper (for example's sake, theirs is called "default") and then the view can be served as normal and placed into the content location. There's also a bit of code showing how to switch out the layout if there's ever a need - like different layouts for the admin, user and main parts of your application.

0 comments voice your opinion now!
zendframework twostep threestep layout wrapper view zendview zendlayout


blog comments powered by Disqus

Similar Posts

Ivo Jansch's Blog: My First Mashup

Padraic Brady's Blog: ZF Blog Tutorial Part 10: Comments, reCAPTCHA and Akismet Filtering

Padraic Brady's Blog: OAuth Specification and Zend Framework/PEAR Proposal

Federico Cargnelutti's Blog: An Alternative to Zend_Controller: The Router

Daniel Cousineau's Blog: Quickie: Module-specific Error Controllers in Zend Framework (1.5)


Community Events

Don't see your event here?
Let us know!


version laravel framework series extension unittest podcast interview laravel5 library threedevsandamaybe voicesoftheelephpant symfony community introduction security release opinion api language

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework