Merge pull request #1184 from slavcodev/only-arrays-in-rules
Using only arrays in rules instead comma-separated string
This commit is contained in:
commit
5221777033
@ -23,7 +23,7 @@ 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'],
|
||||
// verifyCode needs to be entered correctly
|
||||
|
@ -21,7 +21,7 @@ class LoginForm extends Model
|
||||
{
|
||||
return [
|
||||
// username and password are both required
|
||||
['username, password', 'required'],
|
||||
[['username', 'password'], 'required'],
|
||||
// password is validated by validatePassword()
|
||||
['password', 'validatePassword'],
|
||||
// rememberMe must be a boolean value
|
||||
|
Loading…
Reference in New Issue
Block a user