8000 minor #13448 Moving the "On the rendered page" paragraph upwards (Tho… · symfony/symfony-docs@5cb49c5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5cb49c5

Browse files
committed
minor #13448 Moving the "On the rendered page" paragraph upwards (ThomasLandauer)
This PR was squashed before being merged into the 3.4 branch (closes #13448). Discussion ---------- Moving the "On the rendered page" paragraph upwards Nothing changed in the code. Commits ------- e427955 Moving the "On the rendered page" paragraph upwards
2 parents 18bfe44 + e427955 commit 5cb49c5

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

form/form_collections.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,17 @@ new "tag" forms. To render it, make the following change to your template:
273273
...
274274
</ul>
275275

276+
On the rendered page, the result will look something like this:
277+
278+
.. code-block:: html
279+
280+
<ul class="tags" data-prototype="&lt;div&gt;&lt;label class=&quot; required&quot;&gt;__name__&lt;/label&gt;&lt;div id=&quot;task_tags___name__&quot;&gt;&lt;div&gt;&lt;label for=&quot;task_tags___name___name&quot; class=&quot; required&quot;&gt;Name&lt;/label&gt;&lt;input type=&quot;text&quot; id=&quot;task_tags___name___name&quot; name=&quot;task[tags][__name__][name]&quot; required=&quot;required&quot; maxlength=&quot;255&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;">
281+
282+
.. seealso::
283+
284+
If you want to customize the HTML code in the prototype, see
285+
:ref:`form-custom-prototype`.
286+
276287
.. note::
277288

278289
If you render your whole "tags" sub-form at once (e.g. ``form_row(form.tags)``),
@@ -291,12 +302,6 @@ new "tag" forms. To render it, make the following change to your template:
291302
292303
{{ form_widget(form.tags.vars.prototype.name)|e }}
293304
294-
On the rendered page, the result will look something like this:
295-
296-
.. code-block:: html
297-
298-
<ul class="tags" data-prototype="&lt;div&gt;&lt;label class=&quot; required&quot;&gt;__name__&lt;/label&gt;&lt;div id=&quot;task_tags___name__&quot;&gt;&lt;div&gt;&lt;label for=&quot;task_tags___name___name&quot; class=&quot; required&quot;&gt;Name&lt;/label&gt;&lt;input type=&quot;text&quot; id=&quot;task_tags___name___name&quot; name=&quot;task[tags][__name__][name]&quot; required=&quot;required&quot; maxlength=&quot;255&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;">
299-
300305
The goal of this section will be to use JavaScript to read this attribute
301306
and dynamically add new tag forms when the user clicks a "Add a tag" link.
302307
To make things simple, this example uses jQuery and assumes you have it included
@@ -382,11 +387,6 @@ into new ``Tag`` objects and added to the ``tags`` property of the ``Task`` obje
382387

383388
You can find a working example in this `JSFiddle`_.
384389

385-
.. seealso::
386-
387-
If you want to customize the HTML code in the prototype, read
388-
:ref:`form-custom-prototype`.
389-
390390
To make handling these new tags easier, add an "adder" and a "remover" method
391391
for the tags in the ``Task`` class::
392392

0 commit comments

Comments
 (0)
0