diff --git a/book/controller.rst b/book/controller.rst index c10092f10c8..2e01aef0ee7 100644 --- a/book/controller.rst +++ b/book/controller.rst @@ -5,7 +5,7 @@ Controller ========== A controller is a PHP callable 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 @@ -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. @@ -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 ` chapter. @@ -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