Skip to content

Commit bce3f04

Browse files
committed
minor #5114 [Cookbook][Templating] Use best practice to put templates in app/ dir (WouterJ)
This PR was merged into the 2.3 branch. Discussion ---------- [Cookbook][Templating] Use best practice to put templates in app/ dir The section was updated to use an AppBundle, but it was forgotten that templates do not live in AppBundle. This PR fixes that :) | Q | A | --- | --- | Doc fix? | yes | New docs? | no | Applies to | all | Fixed tickets | - Commits ------- 0052478 Use best practice to put templates in app/ dir
2 parents 6ba6ffd + 0052478 commit bce3f04

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cookbook/templating/render_without_controller.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ a simple template that doesn't need any data passed into it, you can avoid
1010
creating the controller entirely, by using the built-in ``FrameworkBundle:Template:template``
1111
controller.
1212

13-
For example, suppose you want to render a ``AppBundle:Static:privacy.html.twig``
13+
For example, suppose you want to render a ``static/privacy.html.twig``
1414
template, which doesn't require that any variables are passed to it. You
1515
can do this without creating a controller:
1616

@@ -22,7 +22,7 @@ can do this without creating a controller:
2222
path: /privacy
2323
defaults:
2424
_controller: FrameworkBundle:Template:template
25-
template: 'AppBundle:Static:privacy.html.twig'
25+
template: static/privacy.html.twig
2626
2727
.. code-block:: xml
2828
@@ -34,7 +34,7 @@ can do this without creating a controller:
3434
3535
<route id="acme_privacy" path="/privacy">
3636
<default key="_controller">FrameworkBundle:Template:template</default>
37-
<default key="template">AppBundle:Static:privacy.html.twig</default>
37+
<default key="template">static/privacy.html.twig</default>
3838
</route>
3939
</routes>
4040
@@ -46,7 +46,7 @@ can do this without creating a controller:
4646
$collection = new RouteCollection();
4747
$collection->add('acme_privacy', new Route('/privacy', array(
4848
'_controller' => 'FrameworkBundle:Template:template',
49-
'template' => 'AppBundle:Static:privacy.html.twig',
49+
'template' => 'static/privacy.html.twig',
5050
)));
5151
5252
return $collection;
@@ -93,7 +93,7 @@ other variables in your route, you can control exactly how your page is cached:
9393
path: /privacy
9494
defaults:
9595
_controller: FrameworkBundle:Template:template
96-
template: 'AppBundle:Static:privacy.html.twig'
96+
template: 'static/privacy.html.twig'
9797
maxAge: 86400
9898
sharedAge: 86400
9999
@@ -107,7 +107,7 @@ other variables in your route, you can control exactly how your page is cached:
107107
108108
<route id="acme_privacy" path="/privacy">
109109
<default key="_controller">FrameworkBundle:Template:template</default>
110-
<default key="template">AppBundle:Static:privacy.html.twig</default>
110+
<default key="template">static/privacy.html.twig</default>
111111
<default key="maxAge">86400</default>
112112
<default key="sharedAge">86400</default>
113113
</route>
@@ -121,7 +121,7 @@ other variables in your route, you can control exactly how your page is cached:
121121
$collection = new RouteCollection();
122122
$collection->add('acme_privacy', new Route('/privacy', array(
123123
'_controller' => 'FrameworkBundle:Template:template',
124-
'template' => 'AppBundle:Static:privacy.html.twig',
124+
'template' => 'static/privacy.html.twig',
125125
'maxAge' => 86400,
126126
'sharedAge' => 86400,
127127
)));

0 commit comments

Comments
 (0)