One question, before I set about extending Zend_Validate_Abstract: In the
example class definition given at
http://framework.zend.com/manual/en/zend.validate.writing_validators.html:
const LENGTH = 'length';
const UPPER = 'upper';
const LOWER = 'lower';
const DIGIT = 'digit';
protected $_messageTemplates = array(
self::LENGTH => "'%value%' must be at least 8 characters in length",
self::UPPER => "'%value%' must contain at least one uppercase letter",
self::LOWER => "'%value%' must contain at least one lowercase letter",
self::DIGIT => "'%value%' must contain at least one digit character"
);
I just wonder why you need the constants. No doubt this is a standard design
technique about which I am simply ignorant. But I'd like to understand why
you couldn't just have
protected $_messageTemplates = array(
'length' => "'%value%' must be at least 8 characters in length",
'upper' => "'%value%' must contain at least one uppercase letter",
'lower' => "'%value%' must contain at least one lowercase letter",
'digit' => "'%value%' must contain at least one digit character"
);
--
David Mintz
http://davidmintz.org/
The subtle source is clear and bright
The tributary streams flow through the darkness