From bcbf1f3a19278dae881cfd084c89554ccd3260b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Vasseur?= Date: Wed, 16 Feb 2022 17:02:57 +0100 Subject: [PATCH] Add documentation for the env DI expresion function --- service_container/expression_language.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/service_container/expression_language.rst b/service_container/expression_language.rst index 972d7286c88..09443b05c08 100644 --- a/service_container/expression_language.rst +++ b/service_container/expression_language.rst @@ -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: