|
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 |
ricklach Smarty Regular
Joined: 27 Aug 2004 Posts: 39
|
Posted: Mon Sep 13, 2004 1:38 am Post subject: Empty attribute |
|
|
I have created a function to check a postal code. the file is called smarty_validate_criteria_isPostalCode.php and here is the code;
function smarty_validate_criteria_isPostalCode($value, $empty, &$params, &$formvars) {
$value = preg_replace("/[\s|-]/", "", $value);
$length = strlen ($value);
//echo "length = " . $length;
if($length == 0) return $empty;
if ($length <> 6) {
return FALSE;
} else {
return preg_match ("/([A-z][0-9]){3}/", $value);
}
}
I then put this code into the Plugins directory. However, when I try to use it here is what I get:
Notice: SmartyValidate: [is_valid] criteria function 'isPostalCode' was not found. in c:\php\smarty\libs\SmartyValidate.class.php on line 387
Which I believe means it cant find the code which is in the c:\php\smarty\libs\plugins directory. Any idea what the problem is? |
|
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
|