FastForms
This is a VERY alpha attempt at self-generating forms. One of the issues I have with Zend Forms is that every time you want to render the form you have to load a huge host of objects; forms are view-related and therefore should be streamlined and able to interprest themselves as templates indepndant of the ORM (fORM?) that you use to compose them.
Zupal FastForms (included below) allow you to choose a template class (right now the only one available renders the form in a table frame, but tableless/div/dl based templates are coming soon), load in fields, and "express" them into a PHP template with variable placeholders for pre-seed values.
Also because most forms end / begin / both with a list of buttons for data submission, this list of controls are treated as a seperate item to be handled with a speial region of the template. If no controls are submited, an automatic "submit" button spawns to ensure that your form can indeed be sent.
There are a lot of sturctural similarities between FastForm and Zend_Form; Elements == Fields
What is missing at this point is the validation you get with Zend_Form -- but as Zend_Validate is independant, you can always use it naked in the actions. (TBD).
I wouldn't ordinarily put something this raw up as an article, but it does show how little code is needed to do 80% of what is currently accomplished by a much, much more bloated library in ZF.
| Attachment | Size |
|---|---|
| Fastform.zip | 32.78 KB |

Post new comment