Symfony validate form with mapped false form fields

后端 未结 5 1058
野的像风
野的像风 2020-12-07 11:47

I\'ve got a form with extra fields added with the option mapped to false. But when I try to validate my form, it won\'t pass indicating \"this valu

5条回答
  •  自闭症患者
    2020-12-07 11:58

    It's works. Checked for symfony 2.1. Code should be like this:

    $builder->add('password', 'password', ['required' => false, 'mapped' => false]);
    

    Of course property 'required' is not required. Example from the documentation.

提交回复
热议问题