From bc623c09e9ed95a602ac22d2b9c9a0a960a9aa15 Mon Sep 17 00:00:00 2001 From: Leevi Graham Date: Wed, 1 Aug 2012 23:54:53 +1000 Subject: [PATCH] Added collection attributes including add, delete to collections html element. Renamed prototype to collection prototype --- .../Resources/views/Form/form_div_layout.html.twig | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig index 0e562e414273f..82bd35dc5651f 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig @@ -31,8 +31,18 @@ {% block collection_widget %} {% spaceless %} + {% set attr = attr|merge({'data-collection': true}) %} + {% if prototype is defined %} - {% set attr = attr|merge({'data-prototype': form_row(prototype) }) %} + {% set attr = attr|merge({'data-collection-prototype': form_row(prototype)}) %} + {% endif %} + + {% if allow_delete is defined %} + {% set attr = attr|merge({'data-collection-delete': allow_delete}) %} + {% endif %} + + {% if allow_add is defined %} + {% set attr = attr|merge({'data-collection-add': allow_add}) %} {% endif %} {{ block('form_widget') }} {% endspaceless %}