Re: Issus while updating from QF to QF2
| From: | Christian Weiske | Date: | Mon, 13 Feb 2012 07:28:29 +0000 |
| Subject: | Re: Issus while updating from QF to QF2 | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-31407@lists.php.net to get a copy of this message | ||
Hello Olaf,
> 1. Adding/use rules with callbacks
>
> I have a login page with a username and password form fields. While
> submitting the form i must supply both field values to a indepent
> class method. The method checks the database if the given combination
> fits. Returns false/true. On PasteBin there is a abstract of the
> current implementation [1].
Instead of providing two parameters, you need to provide a callback[1]:
> $FORM->registerRule(
> 'testSecret', 'callback',
> array($LOGIN, 'testSecret')
> );
[1] http://de.php.net/callback
> 2. The cms uses smarty. To leave the (smarty)templates as clean and
> small as possible, i currently inject a little helper template right
> before rendering the form to avoid putting the same declaration of
> <required> and/or <error> vars (and conditions) over and over on
> every form field within the smarty templates. This little template
> snippet [2] relies on the former func setRequiredTemplate(). Is there
> any complement for this function in QF2?
Not that I know of.
--
Regards/Mit freundlichen Grüßen
Christian Weiske
-=≡ Geeking around in the name of science since 1982 ≡=-
Attachment: [application/pgp-signature] signature.asc
Attachment: [application/pgp-signature] signature.asc