mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-21 00:54:53 +08:00
Merge pull request #2023 from docsolver/patch-1
Corrected an error in the inline validator doc
This commit is contained in:
@@ -119,7 +119,7 @@ needs to be divisible by 10. In the rules you would define: `['attributeName', '
|
||||
Then, your own method could look like this:
|
||||
```php
|
||||
public function myValidationMethod($attribute) {
|
||||
if(($attribute % 10) != 0) {
|
||||
if(($this->$attribute % 10) != 0) {
|
||||
$this->addError($attribute, 'cannot divide value by 10');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user