Skip to content

Commit 18927dc

Browse files
author
daFish
committed
Moved hyperlink to the bottom.
Correctly formatted source code examples.
1 parent 9005984 commit 18927dc

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

cookbook/form/form_collections.rst

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -656,9 +656,6 @@ the relationship between the removed ``Tag`` and ``Task`` object.
656656
updated (whether you're adding new tags or removing existing tags) on
657657
each Tag object itself.
658658

659-
660-
.. _`Owning Side and Inverse Side`: http://docs.doctrine-project.org/en/latest/reference/unitofwork-associations.html
661-
662659
.. _cookbook-form-collections-custom-prototype
663660
664661
Render a custom prototype
@@ -669,17 +666,27 @@ and does not need to be changed. But if you are in the situation were
669666
you need to have a complete custom prototype you can render it yourself:
670667

671668
.. code-block:: html+jinja
672-
data-prototype="{% filter escape %}{% include 'AcmeTaskBundle:Task:prototypeTask.html.twig' with { 'form': form.task.get('prototype') } %}{% endfilter %}"
669+
670+
data-prototype="{% filter escape %}
671+
{% include 'AcmeTaskBundle:Task:prototypeTask.html.twig'
672+
with { 'form': form.task.get('prototype') }
673+
%}
674+
{% endfilter %}"
673675

674676
The included ``AcmeTaskBundle:Task:prototypeTask.html.twig`` contains the
675677
markup used for the prototype. This way you can not only easily structure
676678
your prototype-markup, you can also use this markup to render the
677679
contents of the collection when it already holds items:
678680

679681
.. code-block:: html+jinja
682+
680683
{% for task in tasks %}
681-
{% include 'AcmeTaskBundle:Task:prototypeTask.html.twig' with { 'form': form.task.vars.form } %}
684+
{% include 'AcmeTaskBundle:Task:prototypeTask.html.twig'
685+
with { 'form': form.task.vars.form }
686+
%}
682687
{% endfor %}
683688

684689
This makes sure the displayed items are the same as the newly inserted
685-
from the prototype.
690+
from the prototype.
691+
692+
.. _`Owning Side and Inverse Side`: http://docs.doctrine-project.org/en/latest/reference/unitofwork-associations.html

0 commit comments

Comments
 (0)