Skip to content

Instantly share code, notes, and snippets.

@tobalsan
Created July 29, 2014 11:34
Show Gist options
  • Save tobalsan/08b50379573327b84850 to your computer and use it in GitHub Desktop.
Save tobalsan/08b50379573327b84850 to your computer and use it in GitHub Desktop.
<!-- Customize data-prototype attribute for embedded form collection in Symfony2 -->
<!-- form.html.twig -->
<div id="playerFields" data-prototype="{% filter escape %}{% include 'AcmeTeamBundle:Team:prototype.html.twig' with {'form': form.players.get('prototype')} %}{% endfilter %}"></div>
<!-- prototype.html.twig -->
<div>
<!-- Customize form element rendering as you wish like any other form element -->
{{ form_label(form.name) }}
{{ form_widget(form.name) }}
<div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment