Using Symfony2 UserPassword validator in form type
问题 Im trying to use a specific validator in a form. That form is for an user to redefine his password, he must also enter his current password. For that I use a built in validator from symfony in my form: use Symfony\Component\Security\Core\Validator\Constraints\UserPassword; and the form type looks like that: /** * @param FormBuilderInterface $builder * @param array $options */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('currentpassword', 'password