title: Loop in twig for form symfony2
body: <p>I prog one application for my project.</p>
  
  <p>I have one form for Mesure.</p>
  
  <p>for the moment I have this :</p>
  
  <p><a href="https://i.stack.imgur.com/mBfsX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mBfsX.png" alt="enter image description here"></a></p>
  
  <p>But I want this :</p>
  
  <p><a href="https://i.stack.imgur.com/ZFZP4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZFZP4.png" alt="enter image description here"></a></p>
  
  <p>Have you got a suggestion?</p>
  
  <p>My code is :</p>
  
  <p>MesureType :</p>
  
  <pre><code>public function buildForm(FormBuilderInterface $builder, array $options)
  {
      $builder
      -&gt;add('date')
      -&gt;add('mesure')
      -&gt;add('stagiaire', EntityType::class, array('class' =&gt; 'stbfAdministratifBundle:Stagiaire',
      'choice_label' =&gt; function($allChoices, $currentChoiceKey)
      {
          return $allChoices-&gt;getNom().' '.$allChoices-&gt;getPrenom();
      }
      ,'multiple' =&gt; false));
      $builder-&gt;add('enregistrer', SubmitType::class);
  }
  </code></pre>
  
  <p>My controler :</p>
  
  <pre><code>public function ajouterAction(Request $request)
      {
      $repository = $this-&gt;getDoctrine()
                  -&gt;getManager()
                  -&gt;getRepository('stbfSportifBundle:ParamPhysiologique');
  
          $params = $repository-&gt;findAll();
  
          $uneMesure = new Mesure();
          $form = $this-&gt;get('form.factory')-&gt;create(MesureType::class, $uneMesure);
  
  
          if ($request-&gt;isMethod('POST') &amp;&amp; $form-&gt;handleRequest($request)-&gt;isValid()) {
              $em = $this-&gt;getDoctrine()-&gt;getManager();
              $em-&gt;persist($uneMesure);
              $em-&gt;flush();
  
          }
          return $this-&gt;render('stbfSportifBundle:Mesure:ajouter.html.twig', array('form' =&gt; $form-&gt;createView(), 'param' =&gt; $params));
      }
  </code></pre>
  
  <p>And twig :</p>
  
  <pre><code>{% block body %}
  &lt;h1&gt;Page d'ajout d'une mesure pour un stagiaire&lt;/h1&gt;
  
  &lt;table&gt;
  &lt;tr&gt;
  &lt;td&gt;{{ form_widget(form.date) }}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;{{ form_widget(form.stagiaire) }}&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      {% for param in param %}
  &lt;td&gt;
      {{param.libelle}} : {{ form_widget(form.mesure) }}&lt;/td&gt;
  &lt;/tr&gt;
  {% endfor %}
  &lt;/table&gt;
  {{ form_widget(form.enregistrer, {'attr': {'class': 'btn btn-primary'}}) }}
  {% endblock %}
  </code></pre>
  
  <p>I need you're help, I don't know why my loop don't work.</p>
  
  <p>Thank's for you're help.</p>