File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -163,14 +163,22 @@ validation of constraints won't be triggered.
163
163
To learn more about the expression language syntax, see
164
164
:doc: `/reference/formats/expression_language `.
165
165
166
- Depending on how you use the constraint, you have access to 1 or 2 variables
166
+ Depending on how you use the constraint, you have access to different variables
167
167
in your expression:
168
168
169
169
``this ``
170
170
The object being validated (e.g. an instance of Discount).
171
171
``value ``
172
172
The value of the property being validated (only available when
173
173
the constraint is applied to a property).
174
+ ``context ``
175
+ The :class: `Symfony\\ Component\\ Validator\\ Context\\ ExecutionContextInterface `
176
+ object that provides information such as the currently validated class, the
177
+ name of the currently validated property, the list of violations, etc.
178
+
179
+ .. versionadded :: 7.2
180
+
181
+ The ``context `` variable in expressions was introduced in Symfony 7.2.
174
182
175
183
The ``value `` variable can be used when you want to execute more complex
176
184
validation based on its value:
You can’t perform that action at this time.
0 commit comments