|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
JasonK Smarty n00b
Joined: 03 Jun 2007 Posts: 1
|
Posted: Sun Jun 03, 2007 8:11 pm Post subject: [SmartyValidate] registering class methods |
|
|
I'm having a problem registering a class method with SmartyValidate.
Should something like this work?
Code: |
class myClass {
function myFunc() {
return true;
}
}
$myObj =& new myClass;
SmartyValidate::register_object('obj', $myObj);
SmartyValidate::register_criteria('isValidPassword','obj->myFunc');
SmartyValidate::register_validator('crntpw_valid', 'crntpw', 'isValidPassword');
|
I get the following error:
SmartyValidate: [is_valid] method 'myFunc' is not valid for object 'obj'.
Any help would be appreciated! |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Jun 04, 2007 5:13 am Post subject: |
|
|
it seems that myFunc is not a valid method of the class? |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|