-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] Add option to pass custom values to Expression validator #25504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d5ca7f2
to
e98b8da
Compare
@@ -30,6 +30,7 @@ class Expression extends Constraint | |||
|
|||
public $message = 'This value is not valid.'; | |||
public $expression; | |||
public $values = array(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should it be named $variables?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've named it according to second argument in ExpressionLanguage::evaluate. If $variables is better name, maybe it's worth it to change it there too? What do you guys think?
1b489fc
to
57d79b2
Compare
Ping. Values or variables? Will change in ExpressionLanguage accordingly. Vote by reacting with: |
I'm good with values also. Any other opinion? |
57d79b2
to
ba0565e
Compare
Rebased. More options for naming :
Vote by reacting with: 👍: variables |
Thank you @ostrolucky. |
…sion validator (ostrolucky) This PR was merged into the 4.1-dev branch. Discussion ---------- [Validator] Add option to pass custom values to Expression validator | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - I needed this in a Form. I had no way to pass things from `$options` into Expression validator. Maybe can aid in #23134 Commits ------- ba0565e [Validator] Add option to pass custom values to Expression validator
I needed this in a Form. I had no way to pass things from
$options
into Expression validator.Maybe can aid in #23134