You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: routing.rst
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -462,11 +462,19 @@ and can use any of these variables created by Symfony:
462
462
463
463
The ``params`` variable was introduced in Symfony 6.1.
464
464
465
-
You can also use this function:
465
+
You can also use these functions:
466
466
467
467
``env(string $name)``
468
468
Returns the value of a variable using :doc:`Environment Variable Processors <configuration/env_var_processors>`
469
469
470
+
``service(string $alias)``
471
+
Returns a routing condition service.
472
+
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.
473
+
474
+
.. versionadded:: 6.1
475
+
476
+
The ``service(string $alias)`` function was introduced in Symfony 6.1.
477
+
470
478
Behind the scenes, expressions are compiled down to raw PHP. Because of this,
471
479
using the ``condition`` key causes no extra overhead beyond the time it takes
0 commit comments