如何自定义FOSUserBundle表单

时间:2016-01-14 12:04:43

标签: php symfony fosuserbundle

我遇到了FOSUserBundle自定义的问题。 我被覆盖了FOSUser寄存器表单,然后我从

更改了register_content
{{ form_widget(form) }}

为:

<div class="col-md-6">
{{ form_label(form.firstname) }}
{{ form_errors(form.firstname) }}
{{ form_widget(form.firstname) }}
{{ form_label(form.lastname) }}
{{ form_errors(form.lastname) }}
{{ form_widget(form.lastname) }}
</div>

<div class="col-md-6">
{{ form_label(form.email) }}
{{ form_errors(form.email) }}
{{ form_widget(form.email) }}

{{ form_label(form.plainPassword) }}
{{ form_errors(form.plainPassword) }}
{{ form_widget(form.plainPassword) }}

{{ form_label(form.plainPassword.second) }}
{{ form_errors(form.plainPassword.second) }}
{{ form_widget(form.plainPassword.second) }}
</div>

但是,当我去浏览器时,我得到了它: bad form render

表单呈现错误。我怎么修这个?

1 个答案:

答案 0 :(得分:1)

试试这个

 {{ form_label(form.plainPassword.first) }}
{{ form_errors(form.plainPassword.first) }}
{{ form_widget(form.plainPassword.first) }}

{{ form_label(form.plainPassword.second) }}
{{ form_errors(form.plainPassword.second) }}
{{ form_widget(form.plainPassword.second) }}