{"action":"created","issue":{"url":"https://api.github.com/repos/twigphp/Twig/issues/1917","labels_url":"https://api.github.com/repos/twigphp/Twig/issues/1917/labels{/name}","comments_url":"https://api.github.com/repos/twigphp/Twig/issues/1917/comments","events_url":"https://api.github.com/repos/twigphp/Twig/issues/1917/events","html_url":"https://github.com/twigphp/Twig/issues/1917","id":116567180,"number":1917,"title":"Data-prototype ignore template markup.","user":{"login":"fpilee","id":1960075,"avatar_url":"https://avatars.githubusercontent.com/u/1960075?v=3","gravatar_id":"","url":"https://api.github.com/users/fpilee","html_url":"https://github.com/fpilee","followers_url":"https://api.github.com/users/fpilee/followers","following_url":"https://api.github.com/users/fpilee/following{/other_user}","gists_url":"https://api.github.com/users/fpilee/gists{/gist_id}","starred_url":"https://api.github.com/users/fpilee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fpilee/subscriptions","organizations_url":"https://api.github.com/users/fpilee/orgs","repos_url":"https://api.github.com/users/fpilee/repos","events_url":"https://api.github.com/users/fpilee/events{/privacy}","received_events_url":"https://api.github.com/users/fpilee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-12T15:02:18Z","updated_at":"2015-11-12T15:18:04Z","closed_at":null,"body":"http://symfony.com/doc/current/cookbook/form/form_collections.html#allowing-new-tags-with-the-prototype\r\n\r\nData-prototype attribute ignore the template markup\r\n\r\nFor example for this template \r\n```html\r\n<div id=\"form_items\">\r\n            <ul class=\"items\" data-prototype=\"{{ form_widget(form.items.vars.prototype)|e }}\">\r\n                {% for item in form.items %}\r\n                    <div class=\"col-lg-6\">\r\n                        {{ form_row (item.detalle) }}    \r\n                    </div>\r\n                    <div class=\"col-lg-4\">\r\n                        {{ form_row (item.importe) }}\r\n                    </div>\r\n                {% endfor %}\r\n            </ul>\r\n        </div>\r\n\r\n```\r\n\r\n\r\nI got this data-prototype:\r\n\r\n```html\r\n<ul class=\"items\" data-prototype=\"<div id=&quot;appbundle_factura_items___name__&quot;><div class=&quot;form-group&quot;><label class=&quot;control-label required&quot; for=&quot;appbundle_factura_items___name___detalle&quot;>Detalle</label><input type=&quot;text&quot; id=&quot;appbundle_factura_items___name___detalle&quot; name=&quot;appbundle_factura[items][__name__][detalle]&quot; required=&quot;required&quot; class=&quot;item_detalle form-control&quot; /></div><div class=&quot;form-group&quot;><label class=&quot;control-label required&quot; for=&quot;appbundle_factura_items___name___importe&quot;>Importe</label><input type=&quot;text&quot; id=&quot;appbundle_factura_items___name___importe&quot; name=&quot;appbundle_factura[items][__name__][importe]&quot; required=&quot;required&quot; class=&quot;item_importe form-control&quot; /></div></div>\">\r\n\r\n```\r\n\r\nWhich does not include col-lg-x markup. \r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/twigphp/Twig/issues/comments/156135440","html_url":"https://github.com/twigphp/Twig/issues/1917#issuecomment-156135440","issue_url":"https://api.github.com/repos/twigphp/Twig/issues/1917","id":156135440,"user":{"login":"stof","id":439401,"avatar_url":"https://avatars.githubusercontent.com/u/439401?v=3","gravatar_id":"","url":"https://api.github.com/users/stof","html_url":"https://github.com/stof","followers_url":"https://api.github.com/users/stof/followers","following_url":"https://api.github.com/users/stof/following{/other_user}","gists_url":"https://api.github.com/users/stof/gists{/gist_id}","starred_url":"https://api.github.com/users/stof/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stof/subscriptions","organizations_url":"https://api.github.com/users/stof/orgs","repos_url":"https://api.github.com/users/stof/repos","events_url":"https://api.github.com/users/stof/events{/privacy}","received_events_url":"https://api.github.com/users/stof/received_events","type":"User","site_admin":false},"created_at":"2015-11-12T15:18:04Z","updated_at":"2015-11-12T15:18:04Z","body":"this is expected: you don't use theming of the children but render them manually, while the prototype is rendered using theming. There is no reason for the themed rendering to magically use your extra divs.\r\nIf you want to use divs in the items, you should do it through the form theming for collection items, so that the prototype also uses it: http://symfony.com/doc/current/cookbook/form/form_customization.html#how-to-customize-a-collection-prototype"}}