Skip to content
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
12 changes: 11 additions & 1 deletion routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -462,11 +462,21 @@ and can use any of these variables created by Symfony:

The ``params`` variable was introduced in Symfony 6.1.

You can also use this function:
You can also use these functions:

``env(string $name)``
Returns the value of a variable using :doc:`Environment Variable Processors <configuration/env_var_processors>`

``service(string $alias)``
Returns a routing condition service.
You'll have to add the ``#[AsRoutingConditionService]`` attribute or ``routing.condition_service``
tag to your service if you want to use it in the condition.

.. versionadded:: 6.1

The ``service(string $alias)`` function and ``#[AsRoutingConditionService]`` attribute
was introduced in Symfony 6.1.

Behind the scenes, expressions are compiled down to raw PHP. Because of this,
using the ``condition`` key causes no extra overhead beyond the time it takes
for the underlying PHP to execute.
Expand Down