Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0065bbb

Browse files
committed
Merge branch 'issue_1707' of github.com:joelclermont/symfony-docs into joelclermont-issue_1707
Conflicts:book/service_container.rst
2 parents87c0536 +7b0bfac commit0065bbb

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

‎book/service_container.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,23 @@ The end result is exactly the same as before - the difference is only in
227227
to look for parameters with those names. When the container is built, it
228228
looks up the value of each parameter and uses it in the service definition.
229229

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+
<argumenttype="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+
230247
The purpose of parameters is to feed information into services. Of course
231248
there was nothing wrong with defining the service without using any parameters.
232249
Parameters, however, have several advantages:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp