title: How to set a class attribute to a Symfony2 form input
body: <p>How can I set the <code>HTML</code> <code>class</code> attribute to a form <code>&lt;input&gt;</code> using the <code>FormBuilder</code> in <code>Symfony2</code> ?</p>
  
  <p>Something like this:</p>
  
  <pre><code>-&gt;add('birthdate', 'date',array(
        'input' =&gt; 'datetime',
        'widget' =&gt; 'single_text',
        'attr' =&gt; array(
            'class' =&gt; 'calendar'
        )
   ))
  
   {{ form_widget(form.birthdate) }}
  </code></pre>
  
  <p>I want this <code>input</code>field with the attribute <code>class</code> set to <strong><em>calendar</em></strong></p>