Validator::clientValidateAttribute() now accepts third parameter: a view.

punycode.js asset bundle registering moved from ActiveField to validators.
This commit is contained in:
resurtm
2013-05-15 23:17:50 +06:00
parent 6458b8df8f
commit f7b8595f76
13 changed files with 45 additions and 22 deletions

View File

@@ -126,9 +126,11 @@ class StringValidator extends Validator
* Returns the JavaScript needed for performing client-side validation.
* @param \yii\base\Model $object the data object being validated
* @param string $attribute the name of the attribute to be validated.
* @param \yii\base\View $view the view object that is going to be used to render views or view files
* containing a model form with this validator applied.
* @return string the client-side validation script.
*/
public function clientValidateAttribute($object, $attribute)
public function clientValidateAttribute($object, $attribute, $view)
{
$label = $object->getAttributeLabel($attribute);
$value = $object->$attribute;