Refactor all models to new rules format
This commit is contained in:
parent
c61d43e883
commit
3708ef51ac
@ -23,11 +23,11 @@ class ContactForm extends Model
|
||||
{
|
||||
return [
|
||||
// name, email, subject and body are required
|
||||
['name, email, subject, body', 'required'],
|
||||
[['name', 'email', 'subject', 'body'], 'required'],
|
||||
// email has to be a valid email address
|
||||
['email', 'email'],
|
||||
[['email'], 'email'],
|
||||
// verifyCode needs to be entered correctly
|
||||
['verifyCode', 'captcha'],
|
||||
[['verifyCode'], 'captcha'],
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -21,11 +21,11 @@ class LoginForm extends Model
|
||||
{
|
||||
return [
|
||||
// username and password are both required
|
||||
['username, password', 'required'],
|
||||
[['username', 'password'], 'required'],
|
||||
// password is validated by validatePassword()
|
||||
['password', 'validatePassword'],
|
||||
[['password'], 'validatePassword'],
|
||||
// rememberMe must be a boolean value
|
||||
['rememberMe', 'boolean'],
|
||||
[['rememberMe'], 'boolean'],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user