title: How to style choice field labels in symfony?
body: <p>I have multiple checkboxes in my form. I need to style every checkboxes' labels. What I want to do is described with the code below by the <code>choice_label_attr</code> field:</p>
  
  <pre><code>public function buildForm(FormBuilderInterface $builder, array $options)
  {
      $builder
      -&gt;add('type', ChoiceType::class, array(
          'expanded' =&gt; true,
          'multiple' =&gt; false,
  
          'choices' =&gt; array(
              'Friend' =&gt; 'friend',
              'Guide' =&gt; 'guide'
          ),
  
          // Invalid code, it serves for demonstration purposes
          'choice_label_attr' =&gt; array(
              'class' =&gt; 'btn'
          )
      ));
  }
  </code></pre>
  
  <p>How can this effect be achieved?</p>
  
  <hr>
  
  <h2>Edit</h2>
  
  <p>It is possible to write something like this in the twig templates:</p>
  
  <pre><code>{{ form_label(form.name, 'Your Name', {'label_attr': {'class': 'foo'}}) }}
  </code></pre>
  
  <p>However, this technique is prone to code duplication.</p>