@@ -14,7 +14,7 @@ any action of any controller is the creation of a ``Response`` object which
14
14
Symfony uses to generate the HTML content returned to the user.
15
15
16
16
So far, all the actions shown in this tutorial used the ``$this->render() ``
17
- shortcut to return a rendered response as result. If case you need it, you can
17
+ shortcut to return a rendered response as result. In case you need it, you can
18
18
also create a raw ``Response `` object to return any text content::
19
19
20
20
// src/AppBundle/Controller/DefaultController.php
@@ -125,7 +125,7 @@ its default value::
125
125
}
126
126
127
127
Obviously, when you support several request formats, you have to provide a
128
- tempalte for each of the supported formats. In this case, you should create a
128
+ template for each of the supported formats. In this case, you should create a
129
129
new ``hello.xml.twig `` template:
130
130
131
131
.. code-block :: xml+php
@@ -144,7 +144,7 @@ in your browser.
144
144
145
145
That's all there is to it. For standard formats, Symfony will also
146
146
automatically choose the best ``Content-Type `` header for the response. To
147
- restrict the the formats supported by a given action, use the ``requirements ``
147
+ restrict the formats supported by a given action, use the ``requirements ``
148
148
option of the ``@Route() `` annotation::
149
149
150
150
// src/AppBundle/Controller/DefaultController.php
@@ -190,9 +190,8 @@ method::
190
190
}
191
191
}
192
192
193
- The ``redirectToRoute() `` is similar to the ``path() `` function used in the
194
- templates. It takes the route name and an array of parameters as arguments and
195
- returns the associated friendly URL.
193
+ The ``redirectToRoute() `` method takes as arguments the route name and an optional
194
+ array of parameters and redirects the user to the URL generated with those arguments.
196
195
197
196
You can also internally forward the action to another action of the same or
198
197
different controller using the ``forward() `` method::
@@ -226,6 +225,7 @@ use in your controllers::
226
225
*/
227
226
public function indexAction()
228
227
{
228
+ // ...
229
229
throw $this->createNotFoundException();
230
230
}
231
231
}
@@ -241,6 +241,7 @@ Symfony will transform it into a proper ``500`` error page::
241
241
*/
242
242
public function indexAction()
243
243
{
244
+ // ...
244
245
throw new \Exception('Something went horribly wrong!');
245
246
}
246
247
}
@@ -249,7 +250,7 @@ Getting Information from the Request
249
250
------------------------------------
250
251
251
252
Sometimes your controllers need to access the information related to the user
252
- request, such as his/her preferred language, IP address or the URL query parameters.
253
+ request, such as their preferred language, IP address or the URL query parameters.
253
254
To get access to this information, add a new argument of type ``Request `` to the
254
255
action. The name of this new argument doesn't matter, but it must be preceded
255
256
by the ``Request `` type in order to work (don't forget to add the new ``use ``
@@ -346,4 +347,4 @@ That's all there is to it, and I'm not even sure you'll have spent the full
346
347
10 minutes. You were briefly introduced to bundles in the first part, and all the
347
348
features you've learned about so far are part of the core framework bundle.
348
349
But thanks to bundles, everything in Symfony can be extended or replaced.
349
- That's the topic of the :doc: `next part of this tutorial<the_architecture> `.
350
+ That's the topic of the :doc: `next part of this tutorial <the_architecture >`.
0 commit comments