Turning Quickform into a PHP extension will perhaps improve the performance
(not sure) but I think that reproducing its features will take you a long
time. Despite the "serious" barrier you are talking about (which I never
heard of), Quickform seems to be quite popular as a PHP class. The only
barrier someone told me about was related to the fact that it uses
PEAR_Error...
I agree that Quickform is popular (for good reason!) I use and recommend its use all the time.
The problems I run into, especially with newer PHP users, are twofold:
1. People are hesitant to learn what they perceive as an optional add-on to PHP. They worry that it might not always be available (especially web developers who are building sites for others and do not have ultimate control of the server set up).
2. Users have difficulty understanding and working with include_path, and installing and configuring PEAR packages, especially when they have uncooperative ISPs.
One way to address both of these problems is to have Quickform (and HTML_Common) be part of the base PEAR modules that get installed with a new PHP installation (like DB). I think this would be great, but I suppose this is not the list to discuss that.
So I would say that unless you can provide support for custom element
classes, custom validation rule objects, custom renderers (Sigma, Smarty,
Flexy...), custom filters and a plug & play controller, I am not sure such
an extension will be useful, but feel free to do it naturally.
My goal is that out of the box a beginning PHP user can do something like this:
---
class my_form extends webform {
function __construct() {
$this->addElement('text','name','Your Name:');
$this->addElement('submit','submit','Say Hello');
$this->addRule('name','Enter Your name','required');
}
function process() {
$data = $this->getSubmitValues();
print "Hello, " . htmlentities($data['name']);
}
}
$form = new myform();
$form->display();
if ($form->validate()) {
$form->process();
}
----
They don't have to hand code all of the validation rules, they don't have to do anything special to display error messages, safely redisplay user entered values (which is especially labor intensive for select menus) and so on.
All of the other stuff (custom elements and rule objects, support for pluggable renderers) is nice but not a requirement for most beginners.
One way to structure this is to release a version of the extension that handles the basic stuff, and then add all of quickform's great features incrementally.
Another way could be to make the C extension something like "QuickForm lite" which explicitly wouldn't have a lot of the fancy features as a deliberate strategy to get people to "upgrade" to regular PEAR QuickForm as their needs grew.
Good luck :)
Thanks! I have nothing against quickform -- I use it all the time and I think it is fabulous. I just think that for a language that most new users perceive as the easy way to build interactive web pages, PHP (without quickform) makes you do an awful lot of work to get a basic form working.
David