Skip to content

Commit

Permalink
bug #5037 Finish 4644: Update the_controller.rst (teggen, WouterJ)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.3 branch.

Discussion
----------

Finish 4644: Update the_controller.rst

Replaces #4644

| Q | A
| --- | ---
| Doc fix? | yes
| New docs? | no
| Applies to | all
| Fixed tickets | -

Commits
-------

dbc25a6 Removed forwarding section from the quick tour
17c9257 Update the_controller.rst
77342fa Update the_controller.rst
  • Loading branch information
weaverryan committed Mar 14, 2015
2 parents 912682a + dbc25a6 commit 42ba278
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions quick_tour/the_controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand All @@ -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
----------------------

Expand Down

0 comments on commit 42ba278

Please sign in to comment.