Code: Select all
$v = new Zend_Validate();
$v->addValidator(new Zend_Validate_StringLength(6, 12))
->addValidator(new Zend_Validate_Alnum());
if(!$v->isValid($user_name)){
$buffer = implode('<br />', $v->getMessages());
throw new Exception("<br />$buffer");
}Where the '' would contain the contents of the variable itself I would like to prefix that message with the field name so people knew what was going on???'' cannot be less than 6 characters
Cheers,
Alex