Skip to content

Commit

Permalink
minor #5114 [Cookbook][Templating] Use best practice to put templates…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
wouterj committed Mar 29, 2015
2 parents 6ba6ffd + 0052478 commit bce3f04
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions cookbook/templating/render_without_controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ a simple template that doesn't need any data passed into it, you can avoid
creating the controller entirely, by using the built-in ``FrameworkBundle:Template:template``
controller.

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

Expand All @@ -22,7 +22,7 @@ can do this without creating a controller:
path: /privacy
defaults:
_controller: FrameworkBundle:Template:template
template: 'AppBundle:Static:privacy.html.twig'
template: static/privacy.html.twig
.. code-block:: xml
Expand All @@ -34,7 +34,7 @@ can do this without creating a controller:
<route id="acme_privacy" path="/privacy">
<default key="_controller">FrameworkBundle:Template:template</default>
<default key="template">AppBundle:Static:privacy.html.twig</default>
<default key="template">static/privacy.html.twig</default>
</route>
</routes>
Expand All @@ -46,7 +46,7 @@ can do this without creating a controller:
$collection = new RouteCollection();
$collection->add('acme_privacy', new Route('/privacy', array(
'_controller' => 'FrameworkBundle:Template:template',
'template' => 'AppBundle:Static:privacy.html.twig',
'template' => 'static/privacy.html.twig',
)));
return $collection;
Expand Down Expand Up @@ -93,7 +93,7 @@ other variables in your route, you can control exactly how your page is cached:
path: /privacy
defaults:
_controller: FrameworkBundle:Template:template
template: 'AppBundle:Static:privacy.html.twig'
template: 'static/privacy.html.twig'
maxAge: 86400
sharedAge: 86400
Expand All @@ -107,7 +107,7 @@ other variables in your route, you can control exactly how your page is cached:
<route id="acme_privacy" path="/privacy">
<default key="_controller">FrameworkBundle:Template:template</default>
<default key="template">AppBundle:Static:privacy.html.twig</default>
<default key="template">static/privacy.html.twig</default>
<default key="maxAge">86400</default>
<default key="sharedAge">86400</default>
</route>
Expand All @@ -121,7 +121,7 @@ other variables in your route, you can control exactly how your page is cached:
$collection = new RouteCollection();
$collection->add('acme_privacy', new Route('/privacy', array(
'_controller' => 'FrameworkBundle:Template:template',
'template' => 'AppBundle:Static:privacy.html.twig',
'template' => 'static/privacy.html.twig',
'maxAge' => 86400,
'sharedAge' => 86400,
)));
Expand Down

0 comments on commit bce3f04

Please sign in to comment.