Skip to content

Extend ctx.rule with raw rule params #5105

@alko999

Description

@alko999

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" }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions