开发者

Does Zend have validator for greater than 1900

开发者 https://www.devze.com 2023-02-25 09:48 出处:网络
I hav开发者_C百科e a date of birth field and want to add a validator so that no one enters a value less than 1900. Does zend have a validator than can be used for this? I see alnum but I don\'t think

I hav开发者_C百科e a date of birth field and want to add a validator so that no one enters a value less than 1900. Does zend have a validator than can be used for this? I see alnum but I don't think it's enough because it doesn't set a minimum.


Yes, it is greaterThan .............


What about Zend_Validate_GreaterThan ?


Even if it's said that dates are not supported... Just use 1900 as an integer ;-)


Your better off using the between validator, and specifying between 1900 and our present year.

$validator = new Zend_Validate_Between(1900, date('Y'));
0

精彩评论

暂无评论...
验证码 换一张
取 消