Skip to content

Commit

Permalink
Add documentation for the env DI expresion function
Browse files Browse the repository at this point in the history
  • Loading branch information
jvasseur committed Feb 16, 2022
1 parent 9c761ac commit bcbf1f3
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit bcbf1f3

Please sign in to comment.