I am using YML as my validation config format and now have the following setup:
properties:
user_id:
- NotBlank:
message: "Please provide an user id"
...
getters:
newUser:
- "True":
message: "You already have participated!"
...
So basically, I have two validators for my user_id
field:
I don't have to validate the second condition, if the first already failed. Is there some possibility to say, that the newUser
test depends on the NotBlank
test?
(for example with an additional flag like depends: user_id.NotBlank
or something like that)
似乎当前不支持此功能。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.