News Feed
Sections




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

Jason Gilmore's Blog:
How I Learned to Stop Worrying and Love Zend_Form
August 22, 2011 @ 13:57:14

On his blog today Jason Gilmore has a quick post about solving one of his frustrations with Zend_Form (a part of the Zend Framework) - the default form decorators.

It is a fantastically productive framework, one which I happen to use almost every single day. There was however one feature which absolutely drove me crazy. The Zend_Form component's uses the dd, dl, and dt elements as the default form markup decorators, meaning that even a simple contact form consisting of name, email, and message fields and a submit button [is marked up with dl, dt and dds]. [...] It goes without saying that the overwhelming majority of developers do not use these elements to mark up their forms, with the sheer number of questions posted to StackOverflow and elsewhere about getting rid of these decorators backing this assertion.

He gives his simple solution to the issue, something better than removing all of the decorators and using setDecorator to replace them - a simple partial view that echos out the fields directly. The trick is to use the setDecorators call with a "ViewScript" option pointing to your partial and setElementDecorators() call to use a "ViewHelper".

0 comments voice your opinion now!
zendform tutorial markup decorator form


blog comments powered by Disqus

Similar Posts

Matthew Leverton\'s Blog: How to add a custom CAPTCHA to phpBB2

ZendCasts.com: Building a JSON Endpoint with SLIM (Part 1)

PHPMaster.com: An Introduction to Dependency Injection, Service Locators & Factories (Part 1)

Andrew Podner: Lithium: Getting Stuff From Your Database

Padraic Brady's Blog: Zend Framework Blog Tutorial - Part 8: Create/Add Blog Entries (HTMLPurifier)


Community Events





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


code release developer symfony threedevsandamaybe configure unittest framework wordpress library language introduction community interview application podcast install list series api

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