8000 minor #13460 Rephrasing the "If you render your whole" note (2nd atte… · symfony/symfony-docs@91adfc7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 91adfc7

Browse files
committed
minor #13460 Rephrasing the "If you render your whole" note (2nd attempt) (ThomasLandauer)
This PR was merged into the 3.4 branch. Discussion ---------- Rephrasing the "If you render your whole" note (2nd attempt) Re-submitting #13449 to fix conflict Commits ------- 6fb183a Rephrasing the "If you render your whole" note (2nd attempt)
2 parents abe2750 + 6fb183a commit 91adfc7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

form/form_collections.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,6 @@ On the rendered page, the result will look something like this:
268268
If you want to customize the HTML code in the prototype, see
269269
:ref:`form-custom-prototype`.
270270

271-
.. note::
272-
273-
If you render your whole "tags" sub-form at once (e.g. ``form_row(form.tags)``),
274-
then the prototype is automatically available on the outer ``div`` as
275-
the ``data-prototype`` attribute, similar to what you see above.
276-
277271
.. tip::
278272

279273
The ``form.tags.vars.prototype`` is a form element that looks and feels just
@@ -286,6 +280,12 @@ On the rendered page, the result will look something like this:
286280
287281
{{ form_widget(form.tags.vars.prototype.name)|e }}
288282
283+
.. note::
284+
285+
If you render your whole "tags" sub-form at once (e.g. ``form_row(form.tags)``),
286+
the ``data-prototype`` attribute is automatically added to the containing ``div``,
287+
and you need to adjust the following JavaScript accordingly.
288+
289289
The goal of this section will be to use JavaScript to read this attribute
290290
and dynamically add new tag forms when the user clicks a "Add a tag" link.
291291
To make things simple, this example uses jQuery and assumes you have it included

0 commit comments

Comments
 (0)
0