Skip to content

Commit 0f13ce9

Browse files
javiereguiluzweaverryan
authored andcommitted
[quick_tour] rewording and grammar fixes suggested by @weaverryan
1 parent 7c0037e commit 0f13ce9

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

quick_tour/the_controller.rst

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,30 +83,33 @@ The ``generateUrl()`` is the same method as the ``path()`` function used in the
8383
templates. It takes the route name and an array of parameters as arguments and
8484
returns the associated friendly URL.
8585

86-
You can also forward internally the action to another one with the ``forward()``
86+
You can also internally forward the action to another using the ``forward()``
8787
method::
8888

89-
return $this->forward('AcmeDemoBundle:Hello:fancy', array('name' => $name, 'color' => 'green'));
89+
return $this->forward('AcmeDemoBundle:Hello:fancy', array(
90+
'name' => $name,
91+
'color' => 'green'
92+
));
9093

9194
Displaying Error Pages
9295
----------------------
9396

9497
Errors will inevitably happen during the execution of every web application.
9598
In the case of ``404`` errors, Symfony includes a handy shortcut that you can
96-
use on your controllers::
99+
use in your controllers::
97100

98101
throw $this->createNotFoundException();
99102

100103
For ``500`` errors, just throw a regular PHP exception inside the controller and
101-
Symfony will transform it in a proper ``500`` error page::
104+
Symfony will transform it into a proper ``500`` error page::
102105

103106
throw new \Exception('Something went wrong!');
104107

105108
Getting information from the Request
106109
------------------------------------
107110

108-
Symfony automatically injects the ``Request`` object when the controller defines
109-
a variable type hinted with `Symfony\Component\HttpFoundation\Request`::
111+
Symfony automatically injects the ``Request`` object when the controller has an
112+
argument that's type hinted with ``Symfony\Component\HttpFoundation\Request`::
110113

111114
use Symfony\Component\HttpFoundation\Request;
112115

@@ -158,8 +161,8 @@ from any controller::
158161
}
159162

160163
You can also store "flash messages" that will auto-delete after the next request.
161-
They are useful for instance when you need to set a success message before
162-
redirecting the user to another page (which will then show the message)::
164+
They are useful when you need to set a success message before redirecting the
165+
user to another page (which will then show the message)::
163166

164167
// store a message for the very next request (in a controller)
165168
$session->getFlashBag()->add('notice', 'Congratulations, your action succeeded!');

0 commit comments

Comments
 (0)