We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
希望可以增加一个StringMessage方法,就像StringRule一样可以把错误消息用 tag 的写法来声明。
The text was updated successfully, but these errors were encountered:
可以写个代码示例看看吗?哪种样子的
Sorry, something went wrong.
就比如说增加规则的时候我可以使用v.StringRule("username", "required|minLen:4|maxLen:12|alphaDash")来设置校验规则。同理可否有一个类似的函数来增加错误消息呢?例如v.StringMessage("username","required:用户名为必填项|minLen:用户名至少 4 个字符|maxLen:用户名最多 12 个字符|alphaDash:用户名只允许字母, 数字, 破折号以及下划线")
v.StringRule("username", "required|minLen:4|maxLen:12|alphaDash")
v.StringMessage("username","required:用户名为必填项|minLen:用户名至少 4 个字符|maxLen:用户名最多 12 个字符|alphaDash:用户名只允许字母, 数字, 破折号以及下划线")
inhere
No branches or pull requests
希望可以增加一个StringMessage方法,就像StringRule一样可以把错误消息用 tag 的写法来声明。
The text was updated successfully, but these errors were encountered: