Validation of a form - I'm getting the labels two times

前端 未结 2 1471
清歌不尽
清歌不尽 2021-01-02 18:51

I have a registration form - from FOSUserBundle this is in the template:

{% form_theme form \'AcmeMyBundle:Form:errors.html.twig\' %}

   
2条回答
  •  执笔经年
    2021-01-02 19:17

    # config.yml
    # ...
    fos_user:
        db_driver:     orm
        firewall_name: main
        user_class:    Acme\YourBundle\Entity\User
        registration:
            form:
                type: acme_user_registration
                validation_groups: [Registration]
    # ... 
    

    Adding the last line ("validation_groups: [Registration]") results in only one error. Only FOSUserBundle validation: "Registration".

提交回复
热议问题