QuickForm2 and smarty
| From: | Alain Williams | Date: | Fri, 18 Dec 2009 17:26:25 +0000 |
| Subject: | QuickForm2 and smarty | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-53141@lists.php.net to get a copy of this message | ||
I picked this up again after a break ...
I refer you to:
http://www.phcomp.co.uk/TechTutorial/QfSmarty/index.php
this has the full source code that you can view. Unfortunately it does not
show it running since the machine is running PHP 5.1 -- I will upgrade this
at some stage.
Note that I provide a patched version of the array renderer Array.php.
I also have Qf2ValidTypes.php -- this demonstrates one of every type of
input field that QF2 handles. There is also a smarty version of this.
Feedback on this is requested:
* what have I got wrong
* what have I missed
I would like to make these a useful resource for anyone using QF2.
Something showing all the possibilities of input validation would also
be useful.
Issues that I have (some have been notified before), consider these
bugs or requests for enhancements:
1) 'group' and 'fieldset' do not have a 'type' member of their
array/object.
This could be really useful for something that is inspecting the array.
2) 'fieldset' has a 'name' member of their array that is the empty string.
I have tried various ways of setting it without success. This would be
really nice for looking through the array to find something.
3) checkboxes, this should be returned as an array with however many elements
set to what the user has selected. I could only do this by creating
elements with names like 'vegetable[1]' -- it should be much easier.
4) checkboxes and radio buttons, it should be possible to set up a whole set
of them at one go as can be done with a 'select'. Currently you need to
have a loop -- it should be much easier.
Note that there is a bit of on the fly munging that is done on radio buttons.
Here you have separate fields all with the same name. The smarty renderer makes
the top level one an array with the separate fields as members keyed by the 'id'.
This makes it possible for a smarty template to handle.
It might be nice to do the same for checkboxes if (3) above is done in the right way.
Regards
--
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256 http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information: http://www.phcomp.co.uk/contact.php
Past chairman of UKUUG: http://www.ukuug.org/
#include <std_disclaimer.h>