Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Prev Previous commit
Next Next commit
Fixed some other minor stuff
  • Loading branch information
wouterj committed Nov 5, 2014
commit b7356429657e0c4dbc0c54b5406f54d4e260f7dd
15 changes: 9 additions & 6 deletions book/controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ see :ref:`controller-string-syntax`.

.. tip::

You can learn much more about the routing system in the :doc:`Routing chapter </book/routing>`.
You can learn much more about the routing system in the
:doc:`Routing chapter </book/routing>`.

.. index::
single: Controller; Controller arguments
Expand All @@ -225,15 +226,15 @@ to that method::
{
public function indexAction($name)
{
// ...
// ...
}
}

The controller has a single argument, ``$name``, which corresponds to the
``{name}`` parameter from the matched route (``ryan`` in the example). In
fact, when executing your controller, Symfony matches each argument of
the controller with a parameter from the matched route. Take the following
example:
the controller with a parameter from the matched route by its name. Take the
following example:

.. configuration-block::

Expand Down Expand Up @@ -421,15 +422,17 @@ Common Controller Tasks
Though a controller can do virtually anything, most controllers will perform
the same basic tasks over and over again. These tasks, such as redirecting,
forwarding, rendering templates and accessing core services, are very easy
to manage in Symfony.
to manage in Symfony when you're extending the base ``Controller`` class.

.. index::
single: Controller; Redirecting

Redirecting
~~~~~~~~~~~

If you want to redirect the user to another page, use the ``redirect()`` method::
If you want to redirect the user to another page, use the
:method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::redirect`
method::

public function indexAction()
{
Expand Down