Re: HTML_QuickForm usage advise wanted
| From: | Ian P. Christian | Date: | Tue, 08 Jun 2004 08:19:03 +0000 |
| Subject: | Re: HTML_QuickForm usage advise wanted | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-12993@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Saturday 05 June 2004 18:47, Ian P. Christian wrote:
> I've been using HTML_QuickForm for a while, and I often find myself wanting
> to do the same thing with it, and have yet to come up with a solution that
> I'm 100% satisfied with, so I thought I would ask here to see if anyone has
> a clean solution.
Well... here goes. Time to share what I've come up with.
Excuse me if examples don't work, they are off the top of my head, but you
should be able to work out what it's trying to achieve :)
A wrapper for quickform that can be used to auto-load forms. much like the
factory method in DB_DataObject. (I've just noticed this extends Quickform, I
have no idea why, I'm not sure it needs to :) ) The configuration for this
wrapper comes from an ini file.
A class extending quickform, providing a system to generate/control multimode
forms. It also has some templating code in there I threw in for fun. I
don't like it, but it's there!
I have also included a 'catagory.php', which is an example form showing how
the multimode stuff works.
I added the multimode processing this morning, and haven't tested it at all.
This isn't mean to be an off the shelf solution, but more an example of how
to solve the question I originally asked. I assumed by the lack of responce
that not many people have though about it, or simply don't want to share, so
I have, and am! ;)
Hope this is of some use to you, please do give feedback, I'm always open to
criticism
(i can't submit the .ini config file, forgot to commit it to my SVN
repository. And yes, I know I've spelt catagory wrong, I *always* spell it
wrong in my code, becuase I'm stupid.)
- --
Ian P. Christian
- pookey@pookey.co.uk
- http://www.pookey.co.uk/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFAxXZ/Ee6ncNCcEO0RAkFkAKDIZ8wY9fpEuOPAKRSQUbAcvwAe7QCg0Ryb
vPJKA/hfuKKzIucOMz9uUR4=
=Rleh
-----END PGP SIGNATURE-----
Attachment: [application/x-php] Catagory.php
Attachment: [application/x-php] QuickForm_Multi.php
Attachment: [application/x-php] QuickForm_Wrapper.php
Attachment: [application/x-php] Catagory.php
Attachment: [application/x-php] QuickForm_Multi.php
Attachment: [application/x-php] QuickForm_Wrapper.php