J. Ciszewski
J. Ciszewski

Reputation: 53

How to customize FOSUserBundle forms

I have below problem with FOSUserBundle customization. I was overwritten FOSUser register form, then I changed register_content from

{{ form_widget(form) }}

to:

<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>

But, when I was went to the browser, I got it: bad form render

The form renders incorrectly. How I can repair this?

Upvotes: 0

Views: 119

Answers (1)

Anas EL KORCHI
Anas EL KORCHI

Reputation: 2048

try with this

 {{ 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) }}

Upvotes: 1

Related Questions