title: How to fix these form theming problems in Symfony2?
body: <p>I have multiple questions about forms</p>
  
  <p><strong>First question, how to wrap an input with a div (with classes) in the form builder?</strong></p>
  
  <p>So I want to wrap this submit input :</p>
  
  <pre><code>-&gt;add('Submit', 'submit', array(
      'attr' =&gt;  array(
          'class' =&gt; 'btn btn-success'
      ),
  ))
  </code></pre>
  
  <p>To get this result :</p>
  
  <pre><code>&lt;div class="col-sm-offset-2 col-sm-10"&gt;
      &lt;input type="submit" class="btn btn-success"/&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Second question, how to set a template to a form via the form builder?</strong></p>
  
  <p>Is there a method for this like in my wrong example? Or not?</p>
  
  <pre><code>public function buildForm(FormBuilderInterface $builder, array $options)
  {
      $builder
          -&gt;setTemplate('::vertical-form.html.twig')
          -&gt;add(...)
  }
  </code></pre>
  
  <p><strong>Last question, how to add a class to the form element in a custom form template?</strong></p>
  
  <p>I grab this piece of code from <strong>form_div_layout.html.twig</strong> and I add the class (9th line) to the form element. But it doesn't work, I can't see the  element in my view!</p>
  
  <pre><code>{% block form_start %}
      {% spaceless %}
          {% set method = method|upper %}
          {% if method in ["GET", "POST"] %}
              {% set form_method = method %}
          {% else %}
              {% set form_method = "POST" %}
          {% endif %}
          &lt;form class="form-horizontal" role="form" name="{{ form.vars.name }}" method="{{ form_method|lower }}" action="{{ action }}"{% for attrname, attrvalue in attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}{% if multipart %} enctype="multipart/form-data"{% endif %}&gt;
          {% if form_method != method %}
              &lt;input type="hidden" name="_method" value="{{ method }}" /&gt;
          {% endif %}
      {% endspaceless %}
  {% endblock form_start %}
  </code></pre>
  
  <p>In my views, I've only that piece of code to render the form:</p>
  
  <pre><code>{% form_theme form '::custom-form.html.twig' %}
  {{ form(form_name) }}
  </code></pre>
  
  <p>Maybe should I copy all <strong>form_div_layout.html.twig</strong> file to another template and tweak what I need?</p>
  
  <p>Thanks in advance for your help!</p>