Created
August 26, 2013 14:09
-
-
Save Cyr69/6341807 to your computer and use it in GitHub Desktop.
Customize data-prototype attribute for embedded form collection in Symfony2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Customize data-prototype attribute for embedded form collection in Symfony2 --> | |
<!-- form.html.twig --> | |
<div class="parameters" data-prototype="{% filter escape %}{% include 'AcmeApplicationBundle:Application:field-prototype.html.twig' with {'form': form.parameters.get('prototype')} %}{% endfilter %}"></div> | |
<!-- field-prototype.html.twig --> | |
<div> | |
<!-- Customisez le rendu ici --> | |
<table> | |
<tr> | |
<td> | |
{{ form_label(form.name1) }} | |
{{ form_errors(form.name1) }} | |
{{ form_widget(form.name1) }} | |
</td> | |
<td> | |
{{ form_label(form.name2) }} | |
{{ form_errors(form.name2) }} | |
{{ form_widget(form.name2) }} | |
</td> | |
</tr> | |
</table> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to render a
data-prototype
- as provided by the collection field type - escaped, without spaces and in a single row. Unfortunately the result looks different:https://gist.github.com/webdevilopers/a0b551771aa634b97a57#file-data-prototype-html
Did you solve this?