Wednesday, September 17, 2008

Day 3 - Session 2 - Zend_Layout

This is what's called an UnCon, which isn't an official topic for the ZendCon.

I've attended a few of these, and haven't blogged about them, but from my experience here at ZendCon 08, these are generally more technical, and really discuss what I was looking to hear. The level of complexity at these are more advanced and more to my level rather than a lightweight discussion around implementing solutions.

We're still waiting for the talk to start, but there are technical issues (which seems to be a reoccurring theme today).

Slides: http://www.speedyshare.com/424358692.html

What are layouts?
  • Consistent, independent, and common components of HTML/etc output.

The problem:
  • Generally you used something like Smarty, or some [sic] other hackish implementation.
  • Always include header/footer/et al on each page.
  • Changing the structure for a particular page caused a lot of issues for sub-pages.
  • Attempts w/ZF were trying things like pre/postDispatch events.
The solution is the 2-step-view pattern via Zend_Layout!
Gives total control of view; turn off, change view, partials, etc.

Partials will allow you to modularize your views, and can be reused everywhere.

Use the View methods to capture title, scripts, style information for your Layouts.

---

Summary:
This was a pretty simple discussion, albeit presented extremely solidly.... I give it 2 thumbs up compared to the rest of the sessions I've attended this ZendCon.

No comments: