title: symfony2 multiple nested forms prototype
body: <p>I want to include a collection type inside another collection type.
  It should look like this: <img src="https://i.stack.imgur.com/fceax.jpg" alt="enter image description here"></p>
  
  <p>Using just one collection works fine, but I need to edit the prototype of the outer form, so it renders the prototype of the inner form for each line.</p>
  
  <p>Any ideas how could I do that? Also what would be the best way to save</p>
  
  <p>EDIT:
  Now I am trying to render the prototype of the nested form:</p>
  
  <pre><code>  &lt;ul class="characteristics-container" data-prototype="{{ form_widget(form.characteristics.vars.prototype)|e }}" data-prototype-options="{{ form_widget(form.characteristics.options.vars.prototype|e ) }}"&gt;
                      {# iterate over each existing tag and render its only field: name #}
                      {% for characteristic in form.characteristics %}
                          &lt;li&gt;{{ form_row(characteristic.name) }}&lt;/li&gt;
  
                          &lt;div class="characteristics-options"&gt;
                              {% for opt in form.characteristics.options %}
  
                              {% endfor %}                     
                          &lt;/div&gt;
  
  
                      {% endfor %}
                  &lt;/ul&gt;
  </code></pre>
  
  <p>It gives error in <code>form_widget(form.characteristics.options.vars.prototype|e</code> </p>
  
  <pre><code>Method "options" for object "Symfony\Component\Form\FormView" does not exist in 
  </code></pre>
  
  <p>I tried characteristics[0], and it says the key doesnt exist</p>
  
  <p>Here are my form classes:</p>
  
  <p><strong>PromotionType (the base form)</strong></p>
  
  <pre><code>$builder              
              -&gt;add('characteristics','collection', array(
                  'label'         =&gt; 'Caracteristicas',
                   'type'         =&gt; new PromotionCharacteristicType(),
                   'allow_add'    =&gt; true,
                   'allow_delete' =&gt; true,
                   'by_reference' =&gt; false
              ))
  </code></pre>
  
  <p><strong>PromotionCharacteristicType</strong></p>
  
  <pre><code> $builder
              -&gt;add('name',NULL, array('label'  =&gt; 'Nome'))
              -&gt;add('options', 'collection', array(
                  'type' =&gt; new PromotionCharacteristicOptionType(),
                  'allow_add' =&gt; true,
                  'allow_delete' =&gt; true,      
                  'prototype' =&gt; true,
                  'by_reference' =&gt; false,
              ))                       
          ;
  </code></pre>
  
  <p><strong>PromotionCharacteristicOptionType</strong></p>
  
  <pre><code> $builder
              -&gt;add('name',NULL, array('label'  =&gt; 'Nome')) 
          ;
  </code></pre>
  
  <p>The first level prototype, works fine.</p>