phiamo/MopaBootstrapBundle — Issue #39: separate concerns
Author: keymaster
Created: 2012-02-12 11:01:42+00:00
State: open

This looks like a great bundle, but am wondering why you decided to create a coupling between the form builder and presentation layer (view) logic.

eg. From your demo, it appears you have currently approached the generation of bootstrap2 styles, by specifying the style classnames in the formbuilder extension, as follows:

```
$builder
->add('Appended Icon', 'text', array(
'widget_addon' => array(
'icon' => 'pencil', // why is this specified in form builder?
'append' => true // why is this specified in form builder?
),
'attr' => array(
'class' => 'span1', // why is this specified in form builder?
'placeholder' => 'span1'
)
))
;
````

Since you have already built a new form theme, shouldn't the choice of what icon to display, or what css class to use, be supplied as parameters to your form widgets, all in the view layer ?

ie. something like this:

```
{{ form_widget(form.task, { 'attr': {'class': 'span1'} }) }} // or 'add-on', or 'icon-pencil', or whatever class you choose?

```

I may be missing something, but what is the reason you decided to take the specification of styles out of the view layer and put it into the form builder?