Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 792bf52

Browse files
committed
Merge pull request symfony#1324 from mdpatrick/template_subdirs
Template subdirs
2 parents 15595cd + bcccdc0 commit 792bf52

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

book/controller.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,15 @@ The Symfony templating engine is explained in great detail in the
521521
$templating = $this->get('templating');
522522
$content = $templating->render('AcmeHelloBundle:Hello:index.html.twig', array('name' => $name));
523523

524+
.. note::
525+
526+
It is possible to render templates in deeper subdirectories as well, however
527+
be careful to avoid the pitfall of making your directory structure unduly
528+
elaborate::
529+
530+
$templating->render('AcmeHelloBundle:Hello/Greetings:index.html.twig', array('name' => $name));
531+
// index.html.twig found in Resources/views/Hello/Greetings is rendered.
532+
524533
.. index::
525534
single: Controller; Accessing services
526535

0 commit comments

Comments
 (0)