Zend_Form

Extending Zend Form Element to create customized Phone number field

It’s Zend_Form_Element_Phone, a customized Zend Form Element for Phone Number. This will render 3 text fields for parts of phone number – country code, operator code and subscriber number. The values of these three fields jointly will be considered as the value. Optionally, a separator can be used between these fields. This separator can be ignored from/included in value
Author: Anis Ahmad

by News Robot on September 15, 2010 in News, No Comments »
tags: , ,

Adrian Schneider’s Blog: Caching Zend Framework Forms

On his blog Adrain Schneider shares his ideas about using Zend_Form component. In his first post he talks about typical use cases of the component – defining inputs, filtering, validation, using models and decorators.

I’m often asked what my favorite component of Zend Framework is, and I invariably answer: “Forms”. Forms have always played an awkward role in the model-view-controller paradigm. Sure, the form is just HTML, but to me, it represents something more abstract than that. It represents the HTML form itself, taking user input, normalizing and validating it, and also being able to show the form again when errors occur. This can take quite a large amount of code.

In the second post he presents his way of speeding up forms by introducing caching.

Generating a form is an expensive process in ZF. It’s always bugged me that I can’t find any resources on trying to cache the initial HTML anywhere, so I took a stab at it myself. I use a loader from inside my controller action to load forms and models, so I found that was a good place to start.

by Wojciech Szela on February 18, 2010 in News, No Comments »
tags: ,

Chris Hartjes’ Blog: Creating Usable Forms With Zend Framework

In his recent post Chris Hartjes looks into creating forms in Zend Framework in a little bit more reusable way.

After searching around online for some examples of building simple forms, I was dismayed to discover there were two different ways of building the form. I could (a) do it the long way and create specific instances of the form elements using Zend_Form_Element_X or (b) do it the short way and add them to the form by use of Zend_Form::addElement() and pass it the type of form element I want via an array. For reasons I cannot explain initially, I decided to do things the long way. Later on, I found out that doing it this way saved me from rewriting.

He shows how to separate form from controller, reuse the same form in “add” and “edit” actions and use decorators to change the way form renders.

by Wojciech Szela on February 1, 2010 in News, No Comments »
tags: ,

Tibo Beijen’s Blog: Zend_Form Building dynamic forms

Dynamic forms in Zend Framework can be confusing for many developers. In his latest post Tibo Beijen resolves many doubts one can have about dynamic forms.

In this example I construct a form where a user can view and edit a task list for a week’s working days. Every task can be edited in one single form and new tasks can be added at will. When viewing the page the application fetches the tasks already entered for that week.

He explains how forms work in general and what are the best strategies to create dynamic form in Zend Framework. Tibo also shows how to integrate a form with JQuery and add custom decorators.

by Wojciech Szela on December 23, 2009 in News, No Comments »
tags: ,