File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -246,18 +246,18 @@ and ``data-prototype`` attribute to the existing ``<ul>`` in your template:
246
246
247
247
<ul class="tags" data-index="{{ form.tags|length > 0 ? form.tags|last.vars.name + 1 : 0 }}" data-prototype="{{ form_widget(form.tags.vars.prototype)|e('html_attr') }}"></ul>
248
248
249
- Now add a button just next to the ``<ul> `` to dynamically add a new tag:
250
-
251
- .. code-block :: html+twig
252
-
253
- <button type="button" class="add_item_link" data-collection-holder-class="tags">Add a tag</button>
254
-
255
249
On the rendered page, the result will look something like this:
256
250
257
251
.. code-block :: html
258
252
259
253
<ul class =" tags" data-index =" 0" data-prototype =" < ; div> ;< ; label class=" ; required" ;> ; __name__< ; /label> ;< ; div id=" ; task_tags___name__" ;> ;< ; div> ;< ; label for=" ; task_tags___name___name" ; class=" ; required" ;> ; Name< ; /label> ;< ; input type=" ; text" ; id=" ; task_tags___name___name" ; name=" ; task[tags][__name__][name]" ; required=" ; required" ; maxlength=" ; 255" ; /> ;< ; /div> ;< ; /div> ;< ; /div> ; " >
260
254
255
+ Now add a button just next to the ``<ul> `` to dynamically add a new tag:
256
+
257
+ .. code-block :: html+twig
258
+
259
+ <button type="button" class="add_item_link" data-collection-holder-class="tags">Add a tag</button>
260
+
261
261
.. seealso ::
262
262
263
263
If you want to customize the HTML code in the prototype, see
You can’t perform that action at this time.
0 commit comments