I am defining my own twig layout for new user registration and I have everything laid out the way I want it with the exception of the plainPassword field from the FOSUserBundle.
<p class="left">
{{ form_widget(form.plainPassword) }}
</p>
<div class="clearfix"></div>
The code above displays both the password and verification block. I would like to break this up into the 4 elements of form.plainPassword.label, form.plainPassword.field, form.plainPassword2.label, and form.plainPassword2.field. I cannot figure out what to put in the form_label()
and form_widget()
calls.
<p class="left">
{{ form_label( ??? ) }}
{{ form_widget( ??? ) }}
</p>
<p class="left">
{{ form_label( ??? ) }}
{{ form_widget( ??? ) }}
</p>
<div class="clearfix"></div>
I am assuming this can be done.
I had the same problem. My solution (seems to be official :) :
{{ form_label (form.plainPassword.first) }}
{{ form_widget (form.plainPassword.first) }}
{{ form_label (form.plainPassword.second) }}
{{ form_widget (form.plainPassword.second) }}
Hope it can helps !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With