File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -231,6 +231,15 @@ looks up the value of each parameter and uses it in the service definition.
231
231
232
232
<argument type =" string" >http://symfony.com/?foo=%%s& bar=%%d</argument >
233
233
234
+ .. note ::
235
+
236
+ It can be useful to pass other services in as arguments to your custom service.
237
+ For example, you may want to pass in the `request ` service as an argument.
238
+ In these cases, you may receive a `ScopeWideningInjectionException `.
239
+ To understand this problem better and learn how to solve it, refer to
240
+ the cookbook article :doc: `/cookbook/service_container/scopes ` for a
241
+ few solutions.
242
+
234
243
The purpose of parameters is to feed information into services. Of course
235
244
there was nothing wrong with defining the service without using any parameters.
236
245
Parameters, however, have several advantages:
You can’t perform that action at this time.
0 commit comments