Код: Выделить всё
/**
* Returns the JavaScript code needed to perform client-side validation by calling the {@link clientValidate} method.
* In the client validation code, these variables are predefined:
* <ul>
* <li>value: the current input value associated with this attribute.</li>
* <li>messages: an array that may be appended with new error messages for the attribute.</li>
* <li>attribute: a data structure keeping all client-side options for the attribute</li>
* </ul>
* <b>Example</b>:
*
* If {@link clientValidate} is set to "clientValidate123", clientValidate123() is the name of
* the method that returns the client validation code and can look like:
* <pre>
* <?php
* public function clientValidate123($attribute)
* {
* $js = "if(value != '123') { messages.push('Value should be 123'); }";
* return $js;
* }
* ?>
* </pre>
* @param CModel $object the data object being validated
* @param string $attribute the name of the attribute to be validated.
* @return string the client-side validation script.
* @see CActiveForm::enableClientValidation
* @since 1.1.9
*/
Это описание public function clientValidateAttribute($object,$attribute)
Может я чего не понимаю, но у меня не работает это, если инлайн валидатор метод создавать в используемой модели, работает, только если полностью создать новый валидатор для проверяемого аттрибута.
P.S пример реализации могу скинуть утром,если нужно будет))