Skip to content

Commit e222ee1

Browse files
author
daFish
committed
Moved hyperlink to the bottom.
Correctly formatted source code examples.
1 parent e42a5a5 commit e222ee1

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

cookbook/form/form_collections.rst

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

732-
.. _`Owning Side and Inverse Side`: http://docs.doctrine-project.org/en/latest/reference/unitofwork-associations.html
733-
.. _`JSFiddle`: http://jsfiddle.net/847Kf/4/
734-
735732
.. _cookbook-form-collections-custom-prototype
736733
737734
Render a custom prototype
@@ -741,18 +738,29 @@ Most of the time the provided prototype will be sufficient for your needs
741738
and does not need to be changed. But if you are in the situation were
742739
you need to have a complete custom prototype you can render it yourself:
743740

744-
.. code-block:: html+jinja
745-
data-prototype="{% filter escape %}{% include 'AcmeTaskBundle:Task:prototypeTask.html.twig' with { 'form': form.task.get('prototype') } %}{% endfilter %}"
741+
.. code-block:: html+jinja
742+
743+
data-prototype="{% filter escape %}
744+
{% include 'AcmeTaskBundle:Task:prototypeTask.html.twig'
745+
with { 'form': form.task.get('prototype') }
746+
%}
747+
{% endfilter %}"
746748

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

752754
.. code-block:: html+jinja
755+
753756
{% for task in tasks %}
754-
{% include 'AcmeTaskBundle:Task:prototypeTask.html.twig' with { 'form': form.task.vars.form } %}
757+
{% include 'AcmeTaskBundle:Task:prototypeTask.html.twig'
758+
with { 'form': form.task.vars.form }
759+
%}
755760
{% endfor %}
756761

757762
This makes sure the displayed items are the same as the newly inserted
758763
from the prototype.
764+
765+
.. _`Owning Side and Inverse Side`: http://docs.doctrine-project.org/en/latest/reference/unitofwork-associations.html
766+
.. _`JSFiddle`: http://jsfiddle.net/847Kf/4/

0 commit comments

Comments
 (0)