File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,23 @@ The end result is exactly the same as before - the difference is only in
227
227
to look for parameters with those names. When the container is built, it
228
228
looks up the value of each parameter and uses it in the service definition.
229
229
230
+ .. note ::
231
+
232
+ The percent sign inside a parameter or argument, as part of the string, must
233
+ be escaped with another percent sign:
234
+
235
+ .. code-block :: xml
236
+
237
+ <argument type =" string" >http://symfony.com/?foo=%%s& bar=%%d</argument >
238
+
239
+ .. caution ::
240
+
241
+ You may receive a
242
+ :class: `Symfony\\ Component\\ DependencyInjection\\ Exception\\ ScopeWideningInjectionException `
243
+ when passing the ``request `` service as an argument. To understand this
244
+ problem better and learn how to solve it, refer to the cookbook article
245
+ :doc: `/cookbook/service_container/scopes `.
246
+
230
247
The purpose of parameters is to feed information into services. Of course
231
248
there was nothing wrong with defining the service without using any parameters.
232
249
Parameters, however, have several advantages:
You can’t perform that action at this time.
0 commit comments