You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cookbook/form/form_collections.rst
-15Lines changed: 0 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -803,20 +803,5 @@ contents of the collection when it already holds items:
803
803
This makes sure the displayed items are the same as the newly inserted
804
804
from the prototype.
805
805
806
-
But if you are in the situation were you need to have a complete custom prototype you can render it yourself:
807
-
808
-
.. code-block:: html+jinja
809
-
data-prototype="{% filter escape %}{% include 'AcmeTaskBundle:Task:prototypeTask.html.twig' with { 'form': form.task.get('prototype') } %}{% endfilter %}"
810
-
811
-
The included `AcmeTaskBundle:Task:prototypeTask.html.twig` contains the markup used for the prototype. This way you can not only easily structure your prototype-markup, you can
812
-
also use this markup to render the contents of the collection when it already holds items:
813
-
814
-
.. code-block:: html+jinja
815
-
{% for task in tasks %}
816
-
{% include 'AcmeTaskBundle:Task:prototypeTask.html.twig' with { 'form': form.task.vars.form } %}
817
-
{% endfor %}
818
-
819
-
This makes sure the displayed items are the same as the newly inserted from the prototype.
820
-
821
806
.. _`Owning Side and Inverse Side`: http://docs.doctrine-project.org/en/latest/reference/unitofwork-associations.html
0 commit comments