Skip to content

Commit 831b867

Browse files
committed
minor symfony#13447 Rephrasing data-prototype paragraph (ThomasLandauer)
This PR was merged into the 3.4 branch. Discussion ---------- Rephrasing `data-prototype` paragraph Commits ------- 4d76f62 Rephrasing `data-prototype` paragraph
2 parents 5cb49c5 + 4d76f62 commit 831b867

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

form/form_collections.rst

+4-6
Original file line numberDiff line numberDiff line change
@@ -262,16 +262,14 @@ add the ``allow_add`` option to your collection field::
262262
]);
263263
}
264264

265-
In addition to telling the field to accept any number of submitted objects, the
266-
``allow_add`` also makes a *"prototype"* variable available to you. This "prototype"
267-
is a little "template" that contains all the HTML to be able to render any
268-
new "tag" forms. To render it, make the following change to your template:
265+
The ``allow_add`` option also makes a ``prototype`` variable available to you.
266+
This "prototype" is a little "template" that contains all the HTML needed to
267+
dynamically create any new "tag" forms with JavaScript. To render the prototype, add
268+
the following ``data-prototype`` attribute to the existing ``<ul>`` in your template:
269269

270270
.. code-block:: html+twig
271271

272272
<ul class="tags" data-prototype="{{ form_widget(form.tags.vars.prototype)|e('html_attr') }}">
273-
...
274-
</ul>
275273

276274
On the rendered page, the result will look something like this:
277275

0 commit comments

Comments
 (0)