 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Ian Christian's Blog: Creating a custom form field type in Symfony 2
by Chris Cornutt August 16, 2011 @ 12:04:37
Ian Christian has added a new post to his blog today showing how you can create a custom form field type in Symfony 2 by extending the AbstractType.
I am finally starting to dive into symfony 2 properly. Yes - it's taken a while, work has taken me in different directions! I found myself needing to create a custom form field type pretty quickly, but couldn't find much in the way of documentation to do so, so I thought I'ld throw it up here; partly to help others, but mostly to get feedback to make sure I'm not approaching this from the wrong angle.
He includes the code that creates his custom "Person" model and the class to create his "transport type" select box that pulls in its values from a "choice list" class. He registers it in his bundle and it can then be included in his buildForm() method just like any other form field.
voice your opinion now!
symfony tutorial custom form field select abstract
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
Zend Developer Zone: Building AutoComplete Inputs with PHP, PEAR, Dojo and YUI
by Chris Cornutt February 04, 2009 @ 15:29:25
The Zend Developer Zone has a new tutorial posted (from Vikram Vaswani) about adding in an auto-complete input field to your site. His example uses a PEAR class, Dojo and some components of the YUI libraries.
Fortunately, modern programming toolkits like Dojo provide ready-made widgets that have the necessary client-side functions for autocomplete. Add a little bit of server-side glue, in the form of a PHP script that talks to a database to generate valid suggestions, and enabling this functionality in a Web application now becomes a matter of hours, rather than days. In this article, I'll show you how to do this using three different libraries: PEAR HTML_QuickForm, YUI, and Dojo. Come on in, and find out more!
He shows how to combine Dojo, YUI and the HTML_QuickForm PEAR package to create a field that, based on what they enter into the input field, searches a database to find values in that table.
voice your opinion now!
autocomplete input field tutorial yui dojo pear htmlquickform
Vinu Thomas' Blog: Quicker and cleaner Form using Zend Form
by Chris Cornutt February 13, 2008 @ 08:56:00
On his blog today, Vinu Thomas has an example of what he calls a "quicker and cleaner form" using the Zend_Form component of the Zend Framework.
Usually handing forms involves coding the form in HTML and performing client and server side validation, which usually makes the code for complex forms quite unwieldy. Zend_Form which is available in Zend Framework version 1.5 aims at simplifying this process.
With this new version comes the ability to add in methods for validation right into the form definition. His example shows a traditional login form that checks things like if it's required, checking the length and adding filters to modify the input.
voice your opinion now!
zendframework zendform validate field definition
|
Community Events
Don't see your event here? Let us know!
|