8000 [Book][ServiceContainer] Added docs for YAML '@@' escaping by tPl0ch · Pull Request #2354 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[Book][ServiceContainer] Added docs for YAML '@@' escaping #2354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions book/service_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,24 @@ looks up the value of each parameter and uses it in the service definition.

<argument type="string">http://symfony.com/?foo=%%s&bar=%%d</argument>

.. versionadded:: 2.1
Escaping the ``@`` character in YAML parameter values is new in Symfony 2.1.9
and Symfony 2.2.1.

674A .. note::

If you want to use a string that starts with an ``@`` sign as a parameter
value (i.e. a very safe mailer password) in a yaml file, you need to escape
it by adding another ``@`` sign (This only applies to the YAML format):

.. code-block:: yaml

# app/config/parameters.yml
parameters:
# This will be parsed as string "@securepass"
mailer_password: "@@securepass"


The purpose of parameters is to feed information into services. Of course
there was nothing wrong with defining the service without using any parameters.
Parameters, however, have several advantages:
Expand Down
0