-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[WIP] Add section for rendering a custom prototype for collections #1998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
6e3bc9f
931715a
f5c6876
83ae106
e42a5a5
e222ee1
a4f53b5
52f17a3
9ddfc58
3272cfc
c483a90
9b0cef4
30e993d
2c69be5
cb2ba28
0a4acc3
ca43765
8e019f5
dd161e3
20a3385
3b105c7
afd0365
f560f82
981739a
d6de597
fa24ac6
0a4d5c5
f93cca0
acf5d28
cdf2134
4bb0f65
93ae940
f3b942e
819c53c
9f6590b
1fd5af4
44e8ae0
d41ed6c
1a001c7
4ea3f8d
86be71c
4238aad
3ee5187
227d366
f6ff985
f6a3c28
9372cde
727744c
5bae1e1
b9a7381
3f0e5b6
3689506
5aa2ea0
b78465b
a0f318e
4458f7e
5b53d6a
9a49cf2
5173705
f2043eb
709f82a
1cbf5fa
82ae880
216d086
6ac5c55
32cc0c7
cc5ac25
7ed8f00
8821052
e5ea1b1
edd2f8d
28d10e2
3ad7d3c
e1947af
8078bbe
5a95d43
b285fac
c0d447c
242d410
376f009
aca99bb
ae1c12d
7769b89
45d0e00
3908ed2
69f77cd
396f94f
511c418
ff157a4
36e9741
48b3194
aa4c827
621a6c1
a86977c
37f5010
d6d4bcc
39f14b2
c785b83
4f14285
61e1245
984b46e
2e1488e
4590c01
11e38cc
a3147d2
ee3fc29
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
…ion.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -805,8 +805,18 @@ from the prototype. | |
|
||
But if you are in the situation were you need to have a complete custom prototype you can render it yourself: | ||
|
||
.. code-block:: html+jinja | ||
data-prototype="{% filter escape %}{% include 'AcmeTaskBundle:Task:prototypeTask.html.twig' with { 'form': form.task.get('prototype') } %}{% endfilter %}" | ||
.. code-block:: html+jinja | ||
data-prototype="{% filter escape %}{% include 'AcmeTaskBundle:Task:prototypeTask.html.twig' with { 'form': form.task.get('prototype') } %}{% endfilter %}" | ||
|
||
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 | ||
also use this markup to render the contents of the collection when it already holds items: | ||
|
||
.. code-block:: html+jinja | ||
{% for task in tasks %} | ||
{% include 'AcmeTaskBundle:Task:prototypeTask.html.twig' with { 'form': form.task.vars.form } %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
{% endfor %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
|
||
This makes sure the displayed items are the same as the newly inserted from the prototype. | ||
|
||
.. _`Owning Side and Inverse Side`: http://docs.doctrine-project.org/en/latest/reference/unitofwork-associations.html | ||
.. _`JSFiddle`: http://jsfiddle.net/847Kf/4/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a good practise to avoid long lines in code examples, use something like this:
You should also add an empty line between
..code-block:: ...
and the code.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.