"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "docs/guide/input-validation.md" between
yii2-2.0.35.tar.gz and yii2-2.0.36.tar.gz

About: Yii 2 is a high-performance component-based PHP framework for developing large-scale Web applications (source).

input-validation.md  (yii2-2.0.35):input-validation.md  (yii2-2.0.36)
skipping to change at line 350 skipping to change at line 350
An inline validator is one defined in terms of a model method or an anonymous fu nction. The signature of An inline validator is one defined in terms of a model method or an anonymous fu nction. The signature of
the method/function is: the method/function is:
```php ```php
/** /**
* @param string $attribute the attribute currently being validated * @param string $attribute the attribute currently being validated
* @param mixed $params the value of the "params" given in the rule * @param mixed $params the value of the "params" given in the rule
* @param \yii\validators\InlineValidator $validator related InlineValidator ins tance. * @param \yii\validators\InlineValidator $validator related InlineValidator ins tance.
* This parameter is available since version 2.0.11. * This parameter is available since version 2.0.11.
* @param mixed $current the currently validated value of attribute.
* This parameter is available since version 2.0.36.
*/ */
function ($attribute, $params, $validator) function ($attribute, $params, $validator, $current)
``` ```
If an attribute fails the validation, the method/function should call [[yii\base \Model::addError()]] to save If an attribute fails the validation, the method/function should call [[yii\base \Model::addError()]] to save
the error message in the model so that it can be retrieved back later to present to end users. the error message in the model so that it can be retrieved back later to present to end users.
Below are some examples: Below are some examples:
```php ```php
use yii\base\Model; use yii\base\Model;
 End of changes. 2 change blocks. 
1 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)