From 8a88a477738c1c9eb25520717a612a4e07950bed Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Sat, 3 Jan 2015 18:58:18 +0200 Subject: [PATCH 1/2] Update controller.rst --- book/controller.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/book/controller.rst b/book/controller.rst index 942d5a5baab..021fe50b838 100644 --- a/book/controller.rst +++ b/book/controller.rst @@ -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 to construct and return 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 From bd5812421858bc9c295af827333dd3ef0fff7ab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrew=20Marcinkevi=C4=8Dius?= Date: Mon, 9 Mar 2015 10:18:22 +0200 Subject: [PATCH 2/2] Update controller.rst --- book/controller.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/controller.rst b/book/controller.rst index 021fe50b838..1528146dd73 100644 --- a/book/controller.rst +++ b/book/controller.rst @@ -5,7 +5,7 @@ Controller ========== A controller is a PHP function you create that takes information from the -HTTP request to construct and return 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