Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Empty attribute

 
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
ricklach
Smarty Regular


Joined: 27 Aug 2004
Posts: 39

PostPosted: Mon Sep 13, 2004 1:38 am    Post subject: Empty attribute Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP