title: Embedded forms in Symfony 1.4: why do I have to use a wrapper?
body: <p>I'm building a form allowing me to edit all the row of a given table at the same time with Symfony 1.4.
  To do so I've used embedded forms. My solution is working but I'm wondering why do I have to use an wrapper for my embedded forms?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>class FooCollectionForm extends BaseForm
  {
    public function configure()
    {    
      $wrapperForm = new sfForm();
      foreach ($this-&gt;getOption('bar') as $bar)
      {
        $form = new myForm();
        $form-&gt;widgetSchema-&gt;setNameFormat('foo_collection['.$bar['label'] . '][%s]');
        $wrapperForm-&gt;embedForm($bar['label'], $form);
      }
  
      $this-&gt;embedForm('foo_collection', $wrapperForm);
    }
  }
  </code></pre>
  
  <p>I find that the setNameFormat's parameter is quit ugly but it seems that it is the way it works. Do you agree on that or is there a better solution?</p>
  
  <p>I'm building my form's layout manually and here is the loop I have to use to display all my fields:</p>
  
  <pre><code>&lt;?php foreach ($form-&gt;getEmbeddedForm('foo_collection')-&gt;getEmbeddedForm() as $subForm): ?&gt;
    &lt;?php include_partial('form', array('form' =&gt; $subForm)) ?&gt;
  &lt;?php endforeach; ?&gt;
  </code></pre>
  
  <p>Again I find this ugly and I still don't understand why I can't do that <code>$form-&gt;getEmbeddedForm()</code> without using a wrapper form.</p>
  
  <p>I tried to do the same form without the wrapper with a loop like this: </p>
  
  <pre><code>&lt;?php foreach ($form-&gt;getEmbeddedForms() as $subForm): ?&gt;
  </code></pre>
  
  <p>It is almost working except the fact my inputs have the same name and id.</p>