mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-14 05:08:42 +08:00
Validator::clientValidateAttribute() now accepts third parameter: a view.
punycode.js asset bundle registering moved from ActiveField to validators.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user