Skip to content

[DependencyInjection] Add documentation for the env DI expression function #16518

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 11, 2022
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
4 changes: 3 additions & 1 deletion service_container/expression_language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,14 @@ to another service: ``App\Mailer``. One way to do this is with an expression:

To learn more about the expression language syntax, see :doc:`/components/expression_language/syntax`.

In this context, you have access to 2 functions:
In this context, you have access to 3 functions:

``service``
Returns a given service (see the example above).
``parameter``
Returns a specific parameter value (syntax is like ``service``).
``env``
Returns the value of an env variable.

You also have access to the :class:`Symfony\\Component\\DependencyInjection\\Container`
via a ``container`` variable. Here's another example:
Expand Down