braincrafted/bootstrap-bundle — pull request #182 by rdohms (2014-02-05 17:10:53+00:00)
Title: [Proof Of Concept] Button Group

Don't merge this in quite yet, @florianeckerstorfer.
I have opened this PR, so you can take a look at syntax and the way i'm heading and raise any flags so i can finish it up tomorrow.

This adds support for printing all buttons in a single row, as bootstrap expects them to be (as mentioned in #114).

![screen shot 2014-02-05 at 18 09 30](https://f.cloud.github.com/assets/94331/2089536/59ac6fac-8e88-11e3-82e8-84821ac4d2ed.png)

The syntax used on the form objects is:
```
->add('buttons', 'button_group', [
'buttons' => [
'save' => ['type' => 'submit', 'options' => ['label' => 'button.save']],
'cancel' => ['type' => 'button', 'options' => ['label' => 'button.cancel']],
]
]);
```

*Caveat:*
Bootstrap relies on the presence of whitespace between buttons to show them with proper spacing. Since most of the form stuff in symfony is encapsulated by `spaceless` at one point or another, the only way to ensure space between buttons is by using a ` `. Which i did in the template.
Another possible solution is to add a custom style that adds the margin, but this breaks the "don't touch bootstrap" way of things and adds custom CSS, probably not a good idea.
I'll let @florianeckerstorfer weigh in on this.

To Do:
- [x] Add Custom Type for Button Groups
- [x] Add proper rendering blocks and handle proper off-setting
- [ ] Add constraint to only allow buttons in the group
- [ ] Update documentation with examples
- [ ] Tests?
- [ ] Brush off code with phpdocs and etc.