How to use Expressions in Security, Routing, Services, and Validation
Edit this pageWarning: You are browsing the documentation for Symfony 2.4, which is no longer maintained.
Read the updated version of this page for Symfony 6.0 (the current stable version).
How to use Expressions in Security, Routing, Services, and Validation
2.4
The expression functionality was introduced in Symfony 2.4.
In Symfony 2.4, a powerful ExpressionLanguage component was added to Symfony. This allows us to add highly customized logic inside configuration.
The Symfony Framework leverages expressions out of the box in the following ways:
- Configuring services;
- Route matching conditions;
- Checking security and access controls with allow_if;
- Validation.
For more information about how to create and work with expressions, see The Expression Syntax.