@@ -539,57 +539,45 @@ content from the template can be used to create a ``Response`` object::
539539
540540 use Symfony\Component\HttpFoundation\Response;
541541
542- $content = $this->renderView(
543- 'AcmeHelloBundle:Hello:index.html.twig',
544- array('name' => $name)
545- );
542+ $content = $this->renderView('Hello/index.html.twig', array('name' => $name));
546543
547544 return new Response($content);
548545
549546This can even be done in just one step with the ``render() `` method, which
550547returns a ``Response `` object containing the content from the template::
551548
552- return $this->render(
553- 'AcmeHelloBundle:Hello:index.html.twig',
554- array('name' => $name)
555- );
549+ return $this->render('Hello/index.html.twig', array('name' => $name));
556550
557- In both cases, the ``Resources/views/Hello/index.html.twig `` templateinside
558- the `` AcmeHelloBundle `` will be rendered.
551+ In both cases, the ``app/ Resources/views/Hello/index.html.twig `` templatewill
552+ be rendered.
559553
560- The Symfony templating engine is explained in great detail in the
561- :doc: `Templating </book/templating >` chapter.
554+ ..sidebar ::Referencing Templates that Live inside the Bundle
562555
563- ..tip ::
556+ You can also put templates in the ``Resources/views `` directory of a
557+ bundle. You can then reference is with the
558+ ``BundleName:DirectoryName:FileName `` syntax. E.g.
559+ ``AppBundle:Hello:index.html.twig `` would refer to the template located in
560+ ``src/AppBundle/Resources/views/Hello/index.html.twig ``.
564561
565- You can even avoid calling the ``render `` method by using the ``@Template ``
566- annotation. See the
567- :doc: `FrameworkExtraBundle documentation </bundles/SensioFrameworkExtraBundle/annotations/view >`
568- more details.
562+ The Symfony templating engine is explained in great detail in the
563+ :doc: `Templating </book/templating >` chapter.
569564
570565..tip ::
571566
572567 The ``renderView `` method is a shortcut to direct use of the ``templating ``
573568 service. The ``templating `` service can also be used directly::
574569
575570 $templating = $this->get('templating');
576- $content = $templating->render(
577- 'AcmeHelloBundle:Hello:index.html.twig',
578- array('name' => $name)
579- );
571+ $content = $templating->render('Hello/index.html.twig', array('name' => $name));
580572
581573..note ::
582574
583575 It is possible to render templates in deeper subdirectories as well, however
584576 be careful to avoid the pitfall of making your directory structure unduly
585577 elaborate::
586578
587- $templating->render(
588- 'AcmeHelloBundle:Hello/Greetings:index.html.twig',
589- array('name' => $name)
590- );
591- // index.html.twig found in Resources/views/Hello/Greetings
592- // is rendered.
579+ $templating->render('Hello/Greetings/index.html.twig', array('name' => $name));
580+ // renders app/Resources/views/Hello/Greetings/index.html.twig
593581
594582..index ::
595583 single: Controller; Accessing services