this worked for me, i striped some of the code to make it easyer to
understand

namespace NSP\UsersBundle\Validator;

password.php

class Password extends \Symfony\Component\Validator\Constraint
{
    public $message = 'Passwords don`t match';
}

PasswordValidator.php

namespace NSP\UsersBundle\Validator;

use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;

class PasswordValidator extends ConstraintValidator
{

    public function isValid($value, Constraint $constraint)
    {
       if (smth here) {
            $this->setMessage($constraint->message);


            return false;
        }

        return true;
    }
}

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to