File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -269,16 +269,14 @@ add the ``allow_add`` option to your collection field::
269
269
]);
270
270
}
271
271
272
- In addition to telling the field to accept any number of submitted objects, the
273
- `` allow_add `` also makes a * "prototype" * variable available to you. This "prototype"
274
- is a little "template" that contains all the HTML to be able to render any
275
- new "tag" forms. To render it, make the following change to your template:
272
+ The `` allow_add `` option also makes a `` prototype `` variable available to you.
273
+ This "prototype" is a little "template" that contains all the HTML needed to
274
+ dynamically create any new "tag" forms with JavaScript. To render the prototype, add
275
+ the following `` data-prototype `` attribute to the existing `` <ul> `` in your template:
276
276
277
277
.. code-block :: html+twig
278
278
279
279
<ul class="tags" data-prototype="{{ form_widget(form.tags.vars.prototype)|e('html_attr') }}">
280
- ...
281
- </ul>
282
280
283
281
.. note ::
284
282
You can’t perform that action at this time.
0 commit comments