Refactored validators.

This commit is contained in:
Qiang Xue
2013-12-06 14:19:17 -05:00
parent 1c761753a3
commit cb4a8c764c
34 changed files with 501 additions and 665 deletions

View File

@@ -172,10 +172,10 @@ operate without model do. In our case to validate an email we can do the followi
```php
$email = 'test@example.com';
$validator = new yii\validators\EmailValidator();
if ($validator->validateValue($email)) {
if ($validator->validate($email, $error)) {
echo 'Email is valid.';
} else {
echo 'Email is not valid.'
echo $error;
}
```