Page 1 of 1
Form generation in PeecFW - critique
Posted: Tue Feb 01, 2011 9:08 pm
by Peec
Can I get some feedback for PeecFW's new form generation API?
Wiki page with example of use and output:
http://code.google.com/p/peecfw/wiki/Forms
Any suggestions, related to the API?
Re: Form generation in PeecFW - critique
Posted: Wed Feb 02, 2011 1:44 am
by Christopher
Looks fine for a monolithic form builder. People who like that style of coding and the way your form looks should like this system.
Re: Form generation in PeecFW - critique
Posted: Wed Feb 02, 2011 1:49 am
by Zyxist
How do you deal with form layout customization? My experiences show that this is usually the weakest point of most form processors. And how about extending it with new types of fields?
Re: Form generation in PeecFW - critique
Posted: Thu Feb 03, 2011 7:45 am
by Peec
Thanks for feedback.
The form API got created in 2 days, so there are still room for changes and addons.
How do you deal with form layout customization?
Right now it's possible to override the css file in the themes (like any other core frontened files).
Css file looks like this.
http://peecfw.org/Application/core_tpl/ ... W_Form.css
When it comes to modifying the HTML, i am not sure what i will do, either make it impossible or move the generation of HTML to a tpl file and make themes possible to override this tpl file if wanted.
And how about extending it with new types of fields?
My goal is to support all (x)HTML form fields available, as well as HTML5 fields. But there are not yet possible to add custom fields. But good idea, I should make a clean way to implement this.
Re: Form generation in PeecFW - critique
Posted: Thu Feb 03, 2011 8:50 am
by Zyxist
The possibility to create custom form fields is very useful. Suppose that someone would like to have a JavaScript markup editor or use various Dojo components. Form layout customization is also obligatory. You should not assume that a typical person would like to use the HTML structure you will give him, because he or she may get a different layout made by an external webmaster, and what then? I prefer using templates for this mixed with objects to represent certain form widgets. In this way you can define the form structure in a natural way, and still have OOP flexibility, but this requires a good template engine (by "good" I don't mean PHP, because this is not a template engine, but just a language, in addition pretty useless when it comes to write flexible templates).
Re: Form generation in PeecFW - critique
Posted: Thu Feb 03, 2011 8:12 pm
by Peec
I see what you mean.
You are right, so I sat this whole day and implemented the new changes, it made me rewrite the whole API
What I have done is that i have created a class for each field.
fields implements a field interface and extends an abstract.
Now it's totally customizable (in my eyes) and templating of the whole form is pretty easy because i have a getHTML() for each field, but without getHTML you have access to the fields' properties.
I rolled out a new version of PeecFW today with it's changes and updated the wiki page if someone's interested seeing it:
http://code.google.com/p/peecfw/wiki/Forms