Zend Form Validation :: Is there an identity validator for identity? [How to verify that the input is not identical to "str"]

Zend form validation: is there a validator opposite the identifier (i.e. non-identical)? How can I verify that the input is not identical to "str"?

+3
source share
1 answer

AFAIK there is not something like NotIdentical. Have you tried your own validator this way ?:

class My_Validate_NotIdentical extends Zend_Validate_Identical
{
    public function isValid($value)
    {
        return !parent::isValid($value);
    }
}

This is a simple solution - you must also change the verification messages, etc.

+6
source

Source: https://habr.com/ru/post/1788792/


All Articles