 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Jason Gilmore's Blog: How I Learned to Stop Worrying and Love Zend_Form
by Chris Cornutt 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".
voice your opinion now!
zendform tutorial markup decorator form
Ibuildings techPortal: DPCRadio Working with Zend_Form
by Chris Cornutt January 26, 2011 @ 10:08:00
On the Ibuildings techPortal today they've posted the latest episode in their DPCRadio podcast series (as recorded at the Dutch PHP Conference 2010) - a talk from Rob Allen about working with Zend_Form (from the Zend Framework).
Zend_Form is a powerful component than can simplify form handling within your web application. Find out in this session how to make Zend_Form render and validate your form elements and ease the pain of forms on web pages.
We will look at configuration, data filters & validation and error handling. One particularly tricky area is the use of the decorator pattern to control the generated HTML when rendering the form. This session will therefore also take a detailed look at this especially powerful functionality and show how to ensure that your forms are rendered as desired.
To listen you can either use the in-page player or you can download the (rather large) mp3 to listen at your leisure. The slides for the talk can be found here.
voice your opinion now!
dpcradio podcast roballen zendform tutorial
Rob Allen's Blog: Validating dates
by Chris Cornutt November 09, 2010 @ 12:11:12
In a new Zend Framework related post to his blog today Rob Allen takes a look at a different operating mode he found with Zend_Date changing how it handles format specifiers.
I discovered recently that Zend Framework 1's Zend_Date has two operating modes when it comes to format specifiers: iso and php, where iso is the default. When using Zend_Validate_Date in forms, I like to use the php format specifiers as they are what I'm used to and so can easily know what they mean when reviewing code that I wrote months ago.
His example code shows how you can use the standard date formatting strings in a Zend_Form validator (the "php" format) and an example using the Zend_Date::MONTH or Zend_Date::YEAR identifiers (the "iso" format). He also shows how he met two other requirements - validation for empty and a consistent format on the date validation ("Y-m-d").
voice your opinion now!
validate date zendform zendframework iso format
AjaxRay.com: Extending Zend Form Element to create customized Phone number field
by Chris Cornutt September 02, 2010 @ 08:05:06
On the AjaxRay.com site today there's a new tutorial for the Zend Framework users out there with a library they can use to extend Zend_Form for custom phone number fields.
When taking Phone number as user input, we can worn users about phone number format by setting a hint/description and can validate using Regular Expression. [...] Now, if we try provide this feature in Zend Form, that's possible. We can create three individual Zend_Form_Element_Text objects and join there value together to make the phone number. But, in this case, validating them together is a hassle.
Instead of separate fields, the library they create makes it simple to handle them as a whole field. It works as a helper for Zend_Form and lets you set things like the separator between the text fields, a "format" string and a validator to apply to their fields (in the example code, it's the "digits" validator). Sample code is included to show you how it fits in your form.
voice your opinion now!
zendform extend phone number custom field tutorial
Rob Zienert's Blog: Zend_Form Decorators and Composite Elements
by Chris Cornutt June 23, 2010 @ 12:50:12
Rob Zienert has a new post to his blog today looking at Zend_Form decorators and composite elements to make for more powerful forms in your Zend Framework application.
Today had quite a number of Zend_Form-related questions in #zftalk. Everything from Decorators to Composite Elements, you know - the usual Zend_Form questions. What better way to answering questions than with a blog post and some sample code?
His illustration of decorators shows how to put each of the form elements inside of a "DI" tag to help makes the lives of the frontend developers that much simpler. For the composite elements he shows how to use them to group a set of selects into one object that is then validated through Zend_Date for valid date information. You can grab the code for each of these illustrations from this account on Github
voice your opinion now!
zendform decorators composite tutorial
Chris Hartjes' Blog: "U R Doin It Wrong" - Adventures with flexible forms in Zend Framework
by Chris Cornutt March 23, 2010 @ 08:58:40
In a recent post to his blog Chris Hartjes has written about his (mis)adventures with Zend_Form, a powerful but sometimes difficult to use component of the Zend Framework.
Zend_Form is a super-powerful, force-of-nature tool. By force-of-nature I mean it does all this crazy stuff, and you can see it doing it, but I am not alone in admitting that taming it sometimes is very difficult. When building tools to make form programatically you either severely limit peoples options or make it so flexible that there are multiple ways to get something done.
Because the Zend Framework "treats you like an adult" it can be difficult to get just what you want from it (ease of use isn't quite top of the list). In this case, Chris wanted a relatively simple form that did some checking before it successfully submitted. Over and over the form passed without him being able to tell why - the solution was a pretty simple one, though - be sure to create all form elements before you do validation.
He includes some same code - a "before" and "after" for the solution.
voice your opinion now!
zendframework issue zendform solution
|
Community Events
Don't see your event here? Let us know!
|