recaptcha symfony2表单编辑

时间:2015-08-27 23:57:33

标签: symfony recaptcha

我有一个用于编辑用户的表单,并且在用户类中有

    /**
     * @Recaptcha\IsTrue
     */
    public $recaptcha;

和我的FormType:

        $builder
    ->add('email', 'email', array('attr' => array('placeholder' => 'Email'), 'label' => false, 'translation_domain' => 'FOSUserBundle'))
    ->add('firstname', null, array('attr' => array('placeholder' => 'Nom'), 'label' => false, 'translation_domain' => 'FOSUserBundle'))
    ->add('lastname', null, array('attr' => array('placeholder' => 'Prénom'), 'label' => false, 'translation_domain' => 'FOSUserBundle'))
    ->add('telephone', 'number', array('attr' => array('placeholder' => 'Téléphone'), 'label' => false, 'translation_domain' => 'FOSUserBundle', 'constraints' => array(
    new NotBlank(),
    new Length(array('min' => 8, 'max' => 8)),
    ), ))
    ->add('roles', 'choice', array(
    'choices' => array('m' => 'Moniteur', 's' => 'Secrétaire'),
    'label' => false,
    'multiple' => false,
    'expanded' => true,
    'mapped' => false
    ))
    ->add('adress', 'textarea', array('attr' => array('placeholder' => 'Adresse'), 'label' => false, 'translation_domain' => 'FOSUserBundle'))
    ->add('cin', null, array('attr' => array('placeholder' => 'CIN'), 'label' => false, 'translation_domain' => 'FOSUserBundle', 'constraints' => array(
    new NotBlank(),
    new Length(array('min' => 8, 'max' => 8)),
    ), ))
    ->remove('recaptcha', 'ewz_recaptcha')
    ;
}

我删除了它,但错误信息仍然是如何停用它?     添加新用户时返回的错误消息:此值不是有效的验证码。

0 个答案:

没有答案