8000 User double \ instead of four \ in expression service · symfony/symfony-docs@6c60285 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6c60285

Browse files
jbdelhommeauJean-Baptiste Delhommeau
authored and
Jean-Baptiste Delhommeau
committed
User double \ instead of four \ in expression service
1 parent 134a7f0 commit 6c60285

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

service_container/expression_language.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ to another service: ``App\Mailer``. One way to do this is with an expression:
2828
App\Mail\MailerConfiguration: ~
2929
3030
App\Mailer:
31-
arguments: ["@=service('App\\\\Mail\\\\MailerConfiguration').getMailerMethod()"]
31+
arguments: ['@=service("App\\Mail\\MailerConfiguration").getMailerMethod()']
32+
# when using double-quoted strings, the backslash needs to be escaped twice (see https://yaml.org/spec/1.2/spec.html#id2787109)
33+
# arguments: ["@=service('App\\\\Mail\\\\MailerConfiguration').getMailerMethod()"]
3234
3335
.. code-block:: xml
3436

0 commit comments

Comments
 (0)
0