Symfony 2 : Form entity field add "data-*" attribute on each radio input
<p>I have a form with a field of type "entity" displaying radio fields : </p>

<pre><code>-&gt;add(
            'membership',
            'entity',
              array(
                'class' =&gt; 'Comiti\UserBundle\Entity\Membership',
                'expanded' =&gt; true,
                'multiple' =&gt; false,
                'label' =&gt; false,
                'empty_value' =&gt; 'Aucune adhésion',
                'query_builder' =&gt; function (MembershipRepository $er) {
                    return $er-&gt;createQueryBuilder('membership')
                        -&gt;where('membership.club = :club')
                        -&gt;setParameter('club', $this-&gt;authentication_service-&gt;getCurrentClub())
                        -&gt;orderBy('membership.name', 'ASC')
                    ;
                }, 
            )
        )
</code></pre>

<p>I am adding radio fields in my view like that : </p>

<pre><code>{{ form_row(form.membership) }}
</code></pre>

<p>Rendering something like that in html:</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;input type= "radio" name="membership" value="1"&gt;
&lt;input type= "radio" name="membership" value="2"&gt;
&lt;input type= "radio" name="membership" value="3"&gt; </code></pre>
</div>
</div>
</p>

<p>I would like to add "data-price" to each input :</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;input type= "radio" name="membership" data-price="20" value="1"&gt;
&lt;input type= "radio" name="membership" data-price="10" value="2"&gt;
&lt;input type= "radio" name="membership" data-price="15" value="3"&gt; </code></pre>
</div>
</div>
</p>

<p>How can i do that ? </p>