Ben
Ben

Reputation: 25817

Zend Form Validation:: Does exist oposite validator to Identical?[how to check that input not identical to 'str']

Zend Form Validation: Is there a validator that is the opposite of Identical (i.e., notIdentical)? How would I check that an input is not identical to 'str'?

Upvotes: 3

Views: 1509

Answers (1)

Radek
Radek

Reputation: 8376

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

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

It just simplest solution - you should also change validation messages etc.

Upvotes: 6

Related Questions