diff --git a/quick_tour/the_controller.rst b/quick_tour/the_controller.rst index 114b2e587b3..bc90f0af99b 100644 --- a/quick_tour/the_controller.rst +++ b/quick_tour/the_controller.rst @@ -172,8 +172,10 @@ The ``hello`` action will now match URLs like ``/hello/fabien.xml`` or like ``/hello/fabien.js``, because the value of the ``_format`` variable doesn't meet its requirements. -Redirecting and Forwarding --------------------------- +.. _redirecting-and-forwarding: + +Redirecting +----------- If you want to redirect the user to another page, use the ``redirectToRoute()`` method:: @@ -193,23 +195,6 @@ method:: The ``redirectToRoute()`` method takes as arguments the route name and an optional array of parameters and redirects the user to the URL generated with those arguments. -You can also internally forward the action to another action of the same or -different controller using the ``forward()`` method:: - - // src/AppBundle/Controller/DefaultController.php - class DefaultController extends Controller - { - /** - * @Route("/", name="homepage") - */ - public function indexAction() - { - return $this->forward('AppBundle:Blog:index', array( - 'name' => $name - ); - } - } - Displaying Error Pages ----------------------