3 ms·
I think you should have params to the validators, specifically for the regex case, in which the callback_ approach, with registration and such, is quite onerous
by oinksoft 15y ago
I think you should have params to the validators, specifically for the regex case, in which the callback_ approach, with registration and such, is quite onerous.
{
rules: 'regex',
params: {
regex: [/abc/]
}
}
or,
{
rules: 'regex:^foo'
}
- rickharrison 15y agoI like this idea a lot. I chose to start out with the callback_ approach due to trying to mimic the CodeIgniter API. However, this would be much easier especially for just a regex.