From ecaa7da17b098a61957c1ba56c899c2136bca8ac Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 6 Mar 2019 13:29:56 +0100 Subject: [PATCH] Improved the explanation about the forward method --- controller/forwarding.rst | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/controller/forwarding.rst b/controller/forwarding.rst index b8fb3bf8c63..3180ec3b5bc 100644 --- a/controller/forwarding.rst +++ b/controller/forwarding.rst @@ -5,10 +5,14 @@ How to Forward Requests to another Controller ============================================= Though not very common, you can also forward to another controller internally -with the :method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController::forward` -method. Instead of redirecting the user's browser, this makes an "internal" -sub-request and calls the defined controller. The ``forward()`` method returns -the :class:`Symfony\\Component\\HttpFoundation\\Response` object that is returned +with the ``forward()`` method provided by the +:class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController` class +(or :class:`Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerTrait` if +your controller doesn't extend from ``AbstractController``). + +Instead of redirecting the user's browser, this makes an "internal" sub-request +and calls the defined controller. The ``forward()`` method returns the +:class:`Symfony\\Component\\HttpFoundation\\Response` object that is returned from *that* controller:: public function index($name)