There was an error while loading. Please reload this page.
1 parent 27a34ba commit aa85609Copy full SHA for aa85609
cookbook/service_container/scopes.rst
@@ -193,3 +193,14 @@ The service config for this class would look something like this:
193
Injecting the whole container into a service is generally not a good
194
idea (only inject what you need). In some rare cases, like when working
195
with Twig extensions, its necessary to due a shortcoming in Twig itself.
196
+
197
+If you define a controller as a service then you can get a `Request` object
198
+without injecting the container by having it passed in as an argument of your
199
+action method::
200
201
+ use Symfony\Component\HttpFoundation\Request;
202
203
+ public function updateAction(Request $request)
204
+ {
205
+ // ...
206
+ }
0 commit comments