* @since 2.0 */ class InlineValidator extends Validator { /** * @var string the name of the validation method defined in the active record class */ public $method; /** * @var array additional parameters that are passed to the validation method */ public $params; /** * Validates the attribute of the object. * @param \yii\base\Model $object the object being validated * @param string $attribute the attribute being validated */ public function validateAttribute($object, $attribute) { $method = $this->method; $object->$method($attribute, $this->params); } }