I set array('min' => ($value-1)) and would use GreaterThan . Perhaps use a chain and add Digits to make sure you are dealing with numbers. Something like that:
$value = 10; $chain = new Zend_Validate(); $chain->addValidator(new Zend_Validate_Digits()); $chain->addValidator(new Zend_Validate_GreaterThan(array('min' => ($value-1)))); var_dump($chain->isValid($value), $chain->getMessages());
I think, as far as you know, ZF. It would not hurt to receive a function request. It would be nice. Otherwise, GreaterThan and add a parameter.
source share