Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bc623c0

Browse files
committed
Added collection attributes including add, delete to collections html element.
Renamed prototype to collection prototype
1 parent b1618d2 commit bc623c0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,18 @@
3131

3232
{% block collection_widget %}
3333
{% spaceless %}
34+
{% set attr = attr|merge({'data-collection': true}) %}
35+
3436
{% if prototype is defined %}
35-
{% set attr = attr|merge({'data-prototype': form_row(prototype) }) %}
37+
{% set attr = attr|merge({'data-collection-prototype': form_row(prototype)}) %}
38+
{% endif %}
39+
40+
{% if allow_delete is defined %}
41+
{% set attr = attr|merge({'data-collection-delete': allow_delete}) %}
42+
{% endif %}
43+
44+
{% if allow_add is defined %}
45+
{% set attr = attr|merge({'data-collection-add': allow_add}) %}
3646
{% endif %}
3747
{{ block('form_widget') }}
3848
{% endspaceless %}

0 commit comments

Comments
 (0)