How should Zend_Validator_StringLength extended?
MyValidator:
class Zend_Validate_StringLengthNoTags extends Zend_Validate_StringLength {
public function __construct($options = array()) {
parent::__construct($options);
}
public function isValid($value) {
return parent::isValid(trim(strip_tags($value)));
}
}
Use of validator - bug not assign values to $this->_min, $this->_max:
$text->addValidator(new Zend_Validator_StringLengthNoTags(array('max'=>4,'min'=>2)));
Edit:
root of bug: $this->_min==1, $this->_max==null
,
but it should be
$this->_min==2, $this->_max==4
Update: the answer: This was internal application system problem that generate this bug, it fixed soo the code above working. Thanks for all peaple they try to help me.
Thanks