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
Why $context in validator's method isValid($value, array $context = null) is undocumented feature? Does $context contain safe (filtered, validated) values to use them for query to database?
I needed validator for dependent fields, for, example, pair for username-token: token can be validated only if user exists and found that I can use $context besides 'callback' validator. I have found only one mentioned (just right now) in issues about $context#15 (comment) by @weierophinney .
Also, Metthew have answered to my question: "It's not documented, because it's not part of the validator interface. But the way validation chains work, they always get passed the context, which is the full set of values being validated. That said, they are the raw values, and there's no guarantee they are actually valid. The main purpose for having it passed is to do things like password verification (e.g., ensure the password in a reg form was typed twice identically), or to perform validations based on an aggregation of values (e.g., value is not valid by itself, but only when presented in combination with other values).".
The text was updated successfully, but these errors were encountered:
Feature Request
Summary
Why
$context
in validator's methodisValid($value, array $context = null)
is undocumented feature? Does$context
contain safe (filtered, validated) values to use them for query to database?I needed validator for dependent fields, for, example, pair for username-token: token can be validated only if user exists and found that I can use $context besides 'callback' validator. I have found only one mentioned (just right now) in issues about
$context
#15 (comment) by @weierophinney .Also, Metthew have answered to my question: "It's not documented, because it's not part of the validator interface. But the way validation chains work, they always get passed the context, which is the full set of values being validated. That said, they are the raw values, and there's no guarantee they are actually valid. The main purpose for having it passed is to do things like password verification (e.g., ensure the password in a reg form was typed twice identically), or to perform validations based on an aggregation of values (e.g., value is not valid by itself, but only when presented in combination with other values).".
The text was updated successfully, but these errors were encountered: