QF: own rule with callback and 2 parameters
| From: | Cybersmog | Date: | Thu, 25 Nov 2004 08:17:16 +0000 |
| Subject: | QF: own rule with callback and 2 parameters | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-15806@lists.php.net to get a copy of this message | ||
Hi all,
I've created an own rule for my form. This rule should use a callback
function and a second parameter should be passed to that function. If
this parameter is an integer, the variable inside the function is NULL
but if it is a string, I get the correct value within the function.
Snippet from my code:
function qfRuleEmailExists($EMail, $IDUser) {
// check mail address in DB
// $IDUser is NULL, if passed as integer
}
$form->registerRule('EmailExists', 'callback',
'qfRuleEmailExists');
$form->addRule('E-Mail', 'Die E-Mail Adresse existiert schon!',
'EmailExists', $IDUser);
Bug or Feature? Any suggestions?
Thanks in advance,
Peter