Borrowing the competitors' ideas

Zend_Form proposal

The proposal: http://framework.zend.com/wiki/pages/viewpage.action?pageId=3596

There's a useful discussion going on here, more useful than the proposal itself. Among some rather less useful comments (like form validation rules belonging to the View of MVC; judging the quality of the form library on the basis of how far its API is from QuickForm) there are some very good ideas.

If you mean my rants by this, then know that I'm not judging the quality of the proposal or even of the QuickForm. What I originaly meant was that QuickForm is mixing controller parts and views (like defining element attributes directly in PHP “controller” code, for instance) and the Zend proposal was already heading the same way (and it was very awkward for me to use QF with XML/XSLT as a template system because of this). That's where the “still too close to QF's model” comment came from. I find the QF a really good predecessor and to this date I haven't found any better alternative. But it has some flaws that bug me. That's all. – Michael Minicki

One idea is wrapping the form object around the existing form. Let's say we have a file kewl-form.html designed by a web designer. Now we can easily parse it (assuming XHTML) and build two files

  • kewl-form-model.php
  • kewl-form-output.php

The former will just have a long list of

$form->addElement(...);

calls based on actual form elements found in kewl-form.html. The latter will have something along the lines of

<div class="element"><?php echo $form->getElementById('foo')->toHtml(); ?></div>

. Something similar to what QuickHTML renderer does now, but on steroids.

The developer then needs to add validation rules and the like to the auto-generated elements, the designer is free to mangle the presentation in any way he likes. The difference to current template-based approach is that it is possible to hack elements' attributes also and that the form contains actual elements rather than placeholders: much easier for the designer.

That's already the idea behind builders. It is not borrowed from Zend, but from Python's Form_Encode module.

Well, I din't get the builders idea fully, then. :-D BTW, can you also list the form-generation libraries from other languages on this page?

patForms

The site seems quite a bit broken at the moment, working links:

Needs to be reviewed.

Solar_Form

Solar framework also has some form classes, here is a blog post from Paul M. Jones about it containing some QuickForm citicism as well: http://paul-m-jones.com/blog/?p=117

ultimateForm

Very extensive 5000-line object-orientated form class written at the University of Cambridge, under active development. GPL. No errors with error_reporting 2047.

Supports:

  • Full support for every HTML form widget type (including upload, richtext)
  • Simple API: $form = new form (); $form→input (settings… ); $form→richtext (settings…); $result = $form→process ();
  • Full customisation of validation, e.g. required/numeric-only/regexp/regexpi/disallow/etc.
  • XHTML display, as paragraphs/CSS/tables/template
  • Templating support
  • Direct display, or embed in HTML string using $result = $form→process (&$html);
  • Data binding (automatic database table to form widget conversion)
  • Output as a simple array, to e-mail, to confirmation e-mail, to CSV
  • Full output configuration (e.g. choose whether select result in CSV is single column with results or multiple columns with markers)
  • Full error checking and reporting
  • Accessibility
  • Unzip support for upload types
  • Upload to attachment support
  • Choose integrated (default) or external processing
  • GET/POST support
  • Group validation rules
  • The ability to set elements as non-editable
  • Highly configurable (for both overall behaviour and per-widget)
 
competitors.txt · Last modified: 2008/06/03 19:42 (external edit)