title: Symfony/Twig: how to pass additional data to a form?
body: <p>I'm looking for a way to manage all the form data within <code>MyFormType.php</code>. So far I've the <code>label</code> and <code>placeholder</code>, but I'd like to store an additional string, e.g. for <em>"more details"</em>.</p>
  
  <p><strong>AppBundle\Form\Type\MyFormType.php</strong></p>
  
  <pre><code>// ...
  $builder-&gt;add('fieldname', TextType::class, [
      'label' =&gt; 'My label',
      'attr'  =&gt; ['placeholder' =&gt; 'My placeholder'],       
      'additionalData' =&gt; ['info' =&gt; 'More information] // &lt;- ???      
  ]);
  // ...
  </code></pre>
  
  <p><strong>myForm.html.twig</strong></p>
  
  <pre><code>Label: {{form_label(form.fieldname)}} 
  Textfield: {{form_widget(form.fieldname)}}  
  Info: {{form_additionalData(form.fieldname, 'info')}}  {# ??? #}
  </code></pre>
  
  <p>I was thinking about passing the data via an <code>data-*</code>-attribute like:</p>
  
  <pre><code>// ...
  'attr' =&gt; ['data-info' =&gt; 'more information']
  // ...
  </code></pre>
  
  <p>But how to read the data in a good way, without buggy workarounds?</p>
  
  <p>Any best/good practise for this issue?</p>
  
  <p>Thanks in advance!</p>