Skip to content

Commit 801c756

Browse files
committed
minor #3977 [WCM] removed call to deprecated getRequest() method (Baptouuuu)
This PR was submitted for the 2.5 branch but it was merged into the 2.3 branch instead (closes #3977). Discussion ---------- [WCM] removed call to deprecated getRequest() method | Q | A | ---------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.5+ | Fixed tickets | Commits ------- 0fbb1e0 removed call to deprecated getRequest() method
2 parents eb813a5 + f806f65 commit 801c756

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

book/templating.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1500,9 +1500,9 @@ In many cases, you may want to allow a single controller to render multiple
15001500
different formats based on the "request format". For that reason, a common
15011501
pattern is to do the following::
15021502

1503-
public function indexAction()
1503+
public function indexAction(Request $request)
15041504
{
1505-
$format = $this->getRequest()->getRequestFormat();
1505+
$format = $request->getRequestFormat();
15061506

15071507
return $this->render('AcmeBlogBundle:Blog:index.'.$format.'.twig');
15081508
}

0 commit comments

Comments
 (0)