I just started using Twig and I\'m trying to build a registration form. To add a password/re-enter password field I use the \"repeated\" filetype:
->add(\
If you want to seperate both passwords field from a repeated method in your twig template you just have to call back their respective names like:
{{ form_label(form.password.pass, "Password :") }}
{{ form_widget(form.password.pass) }}
{{ form_label(form.password.confirm, "Confirm :") }}
{{ form_widget(form.password.confirm) }}
And of course in your function:
/..
->add('password', 'repeated', array(
'first_name' => 'pass',
'second_name' => 'confirm',
'type' => 'password'
))
Regards.