title: Symfony2 form theme override collection entry row with loop?
body: <p>I have a problem with my form collection entries.</p>
  
  <p>For example my form type.</p>
  
  <pre><code>// ProfileFormType
  public function buildForm(FormBuilderInterface $builder, array $options)
  {
      $builder
          -&gt;add('name')
          -&gt;add('emails', 'collection', array(
              'type' =&gt; new EmailType(),
              'allow_add' =&gt; true,
              'allow_delete' =&gt; true
          ))
      ;
  }
  </code></pre>
  
  <p>Thats the email type for the collection above.</p>
  
  <pre><code>// EmailType
  public function buildForm(FormBuilderInterface $builder, array $options)
  {
      $builder
          -&gt;add('email', 'email')
          -&gt;add('publicAccess')
      ;
  }
  </code></pre>
  
  <p>And now the form theme for that collection entry row.</p>
  
  <pre><code>{%- block _fos_user_profile_form_emails_entry_row %}
      &lt;div class="email form-group{% if form.email.vars.errors | length %} has-error{% endif %}"&gt;
          &lt;div class="input-group col-xs-3"&gt;
              &lt;span class="input-group-addon"&gt;{{ form_widget(form.publicAccess) }}&lt;/span&gt;
              {{ form_widget(form.email) }}
              {#% if loop is defined %}{{ dump(loop) }}{% endif %#}
              &lt;span class="input-group-btn"&gt;&lt;a class="btn btn-success"&gt;&lt;span class="glyphicon glyphicon-plus glyphicon-xs"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;
          &lt;/div&gt;
          {{ form_errors(form.email) }}
      &lt;/div&gt;
  {% endblock -%}
  </code></pre>
  
  <p>But the problem is that i have no loop or other things for the entries...</p>
  
  <p>How can i check if the entry is the last entry of the collection?</p>
  
  <p>The reason is that i want to add the "minus" button instead the "glypicon-plus" for all entries which not the last one.</p>