From 6d25d3aef6dab835294f4147c64bdd0eaa3a82e2 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Fri, 6 Sep 2013 18:44:02 +0400 Subject: [PATCH] Added info about custom validator method signature to Model::rules phpdoc --- framework/yii/base/Model.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/framework/yii/base/Model.php b/framework/yii/base/Model.php index 9d81d83..93b5a6b 100644 --- a/framework/yii/base/Model.php +++ b/framework/yii/base/Model.php @@ -116,6 +116,10 @@ class Model extends Component implements IteratorAggregate, ArrayAccess * function validatorName($attribute, $params) * ~~~ * + * In the above `$attribute` refers to currently validated attribute name while `$params` contains an array of + * validator configuration options such as `max` in case of `length` validator. Currently validate attribute value + * can be accessed as `$this->[$attribute]`. + * * Yii also provides a set of [[Validator::builtInValidators|built-in validators]]. * They each has an alias name which can be used when specifying a validation rule. *