braincrafted/bootstrap-bundle — pull request #294 by derpue (2014-08-21 13:09:55+00:00)
Title: Form attr patch

Despite the great feedback on #291 will this fix all that misuse and generate cleaner markup.

ALL rendering options which are NOT HTML Attributes are moved from the 'attr' array to a new 'opt' array in the fields options array. They did not belong there and were also rendered into the markup:

```php
//wrong and old way:
$builder->add('fieldname', 'fieldtype', array(
'attr' => array('col-size' => 'md')
));

//correct way
$builder->add('fieldname', 'fieldtype', array(
'opt' => array('col-size' => 'md')
));
```
In the attr array belong only html markup attributes for the rendered tag (arbitrary attributes need to be named `data-*` as the spec says)

The forms style property which was used to render the form or an field inline or horizontal is renamed from 'style' to 'form_style' so it will not conflict with the html style attribute.

So in the template you use now
```twig
{{ form(form, { 'form_style': 'horizontal' }) }}
{{ form_start(form, { 'form_style': 'horizontal' }) }}
{{ form_row(form.firstName, { 'form_style': 'horizontal' }) }}
{{ form_label(form.firstName, { 'form_style': 'horizontal' }) }}
```
Before this patch you were also able to set the form style via a 'style' entry in the 'attr' array. This is now 'form_style' in the 'opt' array. So you can finally use the 'attr' 'style' for setting a style to the html tag.