News Feed
Sections




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

Zend Developer Zone:
View Helpers in Zend Framework
April 29, 2008 @ 14:38:27

The Zend Developer Zone has posted a new tutorial (from Matthew Weier O'Phinney) about a handy feature of the Zend Framework's view layer - view helpers that can be added in and reused across an application to do some pretty cool stuff.

A View Helper is simply a class that follows particular naming conventions, When attached to a view object, you can call the helper as if it were a method of the view object itself. The View object retains helper instances, which means that they retain states between calls.

View helpers can be use to do things like manipulate view data for more complex operations and carrying over data between two views, limiting the number of fetches that have to be done. He shows how to create a simple helper - My_Helper_FooBar - that just appends "fooBar " to whatever's passed in. He also talks about some of the default view helpers (like form fields), partials, the doctype() helper, capturing/caching content to be used later and the use of placeholders.

0 comments voice your opinion now!
zendframework view helper form partial doctype capture placeholder


blog comments powered by Disqus

Similar Posts

Padraic Brady's Blog: Interfacing The PHP World Would Be Good

Content with Style Blog: A caching pattern for models

Pádraic Brady's Blog: Complex Views with the Zend Framework - Part 7: Zend_View Enhanced

Padraic Brady's Blog: Zend Framework Caching (Parts 1, 2 & 2b)

Till Klampaeckel's Blog: Debugging Zend_Test


Community Events





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


package framework list voicesoftheelephpant symfony bugfix install tips podcast opinion deployment community library release introduction api laravel series interview language

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