diff --git a/book/templating.rst b/book/templating.rst index 17fee4b3d81..fa274079893 100644 --- a/book/templating.rst +++ b/book/templating.rst @@ -1500,9 +1500,9 @@ In many cases, you may want to allow a single controller to render multiple different formats based on the "request format". For that reason, a common pattern is to do the following:: - public function indexAction() + public function indexAction(Request $request) { - $format = $this->getRequest()->getRequestFormat(); + $format = $request->getRequestFormat(); return $this->render('AcmeBlogBundle:Blog:index.'.$format.'.twig'); }