Skip to content

Instantly share code, notes, and snippets.

@nietzscheson
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nietzscheson/a6091da2eaf5a9282852 to your computer and use it in GitHub Desktop.
Save nietzscheson/a6091da2eaf5a9282852 to your computer and use it in GitHub Desktop.
## http://www.scott-sherwood.com/tutorial/symfony-2-0-embedded-forms-for-collections/
<form>
{% macro prototype(entities) %}
<tr>
<td>{{form_widget(entities.entitie[0])}}</td>
<td>{{form_widget(entities.entitie[1])}} </td>
<td>
<button class="btn btn-default btn-delete">
<span class="glyphicon glyphicon-remove"></span>
</button>
</td>
</tr>
{% endmacro %}
<table class="table table-condensed">
<tbody class="collections">
{% for entities in entity_form.entities %}
{{ _self.prototype(entities) }}
{% endfor %}
</tbody>
</table>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment