ITADN

Extend ctx.rule with raw rule params

#5105Openalko999 创建于 2025-12-18
A
alko999commented
In v3 we can show a names of fields in cross-fields validation messages, but it not supported in v4 without rewriting of validations and rules. As example in v3 we can define "customConfirmed:@password" and get "password" (not "password" value) during message generation. In v4 in generateMessage function we only get ctx.rule.params with value of "password" field, but we can't get field's name.... **Describe the solution you'd like** Please, add ctx.rule.rawParams as a raw validation params ( ["password"]), so we can handle them in generateMessage manually and form a correct message. Or, like in v3 object, like { password: "password" }
0 条评论