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

Commit1b707dd

Browse files
Loïc Chardonnetweaverryan
Loïc Chardonnet
authored andcommitted
Added note on untrimmed parameters (XML)
In XML configuration, the value between` parameter` tags isn't trimmed,which can lead to unexpected behavior.Seesymfony/symfony#8661
1 parent3980b0b commit1b707dd

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

‎components/dependency_injection/parameters.rst‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,27 @@ rather than being tied up and hidden with the service definition:
9797
->register('mailer', 'Mailer')
9898
->addArgument('%mailer.transport%');
9999
100+
..caution::
101+
102+
The values between ``parameter`` tags in XML configuration files are not
103+
trimmed.
104+
105+
This means that the following configuration sample will have the value
106+
``\n sendmail\n``:
107+
108+
..code-block::xml
109+
110+
<parameterkey="mailer.transport">
111+
sendmail
112+
</parameter>
113+
114+
In some cases (for constants or class names), this could throw errors. In
115+
order to prevent this, you must always inline your parameters as follow:
116+
117+
..code-block::xml
118+
119+
<parameterkey="mailer.transport">sendmail</parameter>
120+
100121
If you were using this elsewhere as well, then you would only need to change
101122
the parameter value in one place if needed.
102123

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp