phiamo/MopaBootstrapBundle — Issue #51: form_widget general
Author: peshis
Created: 2012-02-28 01:13:32+00:00
State: open

Hello!

I've stumbled upon another matter regarding form_widget.

Let's say that you have a form that looks like this.

->add('profile', new EditProfileType()
)
->add('username','text', array(
'label' => 'create.username',
'required' => false,
'error_bubbling' => false,
'error_delay' => false,
))
->add('email', 'email', array(
'label' => 'create.email',
'required' => false,
'error_bubbling' => false,
'error_delay' => false,
))

And of course you would like to style the form and separate 'profile' from the rest with a picture or any other content, so you would have to build your form manually in the view like so.

{{ form_widget(form.profile) }}

Example content

{{ form_widget(form.username) }}
{{ form_widget(form.email) }}
{{ form_rest(form) }}

This renders the following, you can see that form.profile renders ok, whilst form.username and form.email is not rendered with any styling. The last content rendered with form_rest(form) renders ok.

edit.firstname

edit.lastname

Example content