Skip to content

Commit a61eb88

Browse files
authored
Update conditions.rst
Undocumented functionality -> injecting container parameters into Route condition
1 parent 7014015 commit a61eb88

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

routing/conditions.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,7 @@ variables that are passed into the expression:
8787

8888
Because of this, using the ``condition`` key causes no extra overhead
8989
beyond the time it takes for the underlying PHP to execute.
90+
91+
.. parameters-block:: Injecting parameters
92+
93+
You can inject container parameters (e.g. `%kernel.environment%`) into condition, such as `@Route(condition="'%kernel.environment' in ['dev']")` or any other you want.

0 commit comments

Comments
 (0)