@@ -729,9 +729,6 @@ the relationship between the removed ``Tag`` and ``Task`` object.
729
729
updated (whether you're adding new tags or removing existing tags) on
730
730
each Tag object itself.
731
731
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
-
735
732
.. _cookbook-form-collections-custom-prototype
736
733
737
734
Render a custom prototype
@@ -741,18 +738,29 @@ Most of the time the provided prototype will be sufficient for your needs
741
738
and does not need to be changed. But if you are in the situation were
742
739
you need to have a complete custom prototype you can render it yourself:
743
740
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 %}"
746
748
747
749
The included ``AcmeTaskBundle:Task:prototypeTask.html.twig `` contains the
748
750
markup used for the prototype. This way you can not only easily structure
749
751
your prototype-markup, you can also use this markup to render the
750
752
contents of the collection when it already holds items:
751
753
752
754
.. code-block :: html+jinja
755
+
753
756
{% 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
+ %}
755
760
{% endfor %}
756
761
757
762
This makes sure the displayed items are the same as the newly inserted
758
763
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