title: dynamic form rendering with twig
body: <p>I'm using silex to build an election simulator app and I need to render a form using the twig template engine. Problem is, the size of the form will depend on the previous form's results and I need to render each field in its corresponding row. It looks very much like a matrix.</p>
  
  <p>In the following example, Lists A and B got more than 10% in the first round so they advance to the second. You can then define the "report" of the votes from all lists that entered the election.</p>
  
  <p><a href="http://img15.hostingpics.net/pics/970049form.jpg" rel="nofollow">http://img15.hostingpics.net/pics/970049form.jpg</a></p>
  
  <p>Each row is generated like so: </p>
  
  <pre><code>foreach($first_round_lists as $list)
  {
      foreach($winners as $key =&gt; $winner)
      {
          $form-&gt;add('list'.$i.$key, null, array('label' =&gt; false, 'attr'=&gt; array('class'=&gt;'entry data', 'maxlength'=&gt;'5', 'value'=&gt;'')));
      }
      $form-&gt;add('blanks-list'.$i, null, array('label' =&gt; false, 'attr'=&gt; array('class'=&gt;'entry data', 'maxlength'=&gt;'5', 'value'=&gt;'')));
      $form-&gt;add('abstention-list'.$i, null, array('label' =&gt; false, 'attr'=&gt; array('class'=&gt;'entry data', 'maxlength'=&gt;'5', 'readonly'=&gt;"readonly")));
      $i++;
  }
  </code></pre>
  
  <p>Any ideas on how I could render this properly using twig ?</p>