Skip to content

Update controller.rst #4747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions book/controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Controller
==========

A controller is a PHP function you create that takes information from the
HTTP request and constructs and returns an HTTP response (as a Symfony
HTTP request and creates and returns an HTTP response (as a Symfony
``Response`` object). The response could be an HTML page, an XML document,
a serialized JSON array, an image, a redirect, a 404 error or anything else
you can dream up. The controller contains whatever arbitrary logic *your
Expand Down Expand Up @@ -34,7 +34,7 @@ common examples:
for the homepage of the site.

* *Controller B* reads the ``slug`` parameter from the request to load a
blog entry from the database and create a ``Response`` object displaying
blog entry from the database and creates a ``Response`` object displaying
that blog. If the ``slug`` can't be found in the database, it creates and
returns a ``Response`` object with a 404 status code.

Expand Down Expand Up @@ -478,7 +478,9 @@ You can also put templates in deeper sub-directories. Just try to avoid creating
unnecessarily deep structures::

// renders app/Resources/views/Hello/Greetings/index.html.twig
return $this->render('Hello/Greetings/index.html.twig', array('name' => $name));
return $this->render('Hello/Greetings/index.html.twig', array(
'name' => $name
));

The Symfony templating engine is explained in great detail in the
:doc:`Templating </book/templating>` chapter.
Expand Down Expand Up @@ -513,7 +515,7 @@ via the ``get()`` method. Here are several common services you might need::

$mailer = $this->get('mailer');

What other services exist? You can list all services, use the ``container:debug``
What other services exist? To list all services, use the ``container:debug``
console command:

.. code-block:: bash
Expand Down