mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-15 05:45:33 +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:
@@ -79,10 +79,12 @@ class RegularExpressionValidator 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.
|
||||
* @throws InvalidConfigException if the "pattern" is not a valid regular expression
|
||||
*/
|
||||
public function clientValidateAttribute($object, $attribute)
|
||||
public function clientValidateAttribute($object, $attribute, $view)
|
||||
{
|
||||
$pattern = $this->pattern;
|
||||
$pattern = preg_replace('/\\\\x\{?([0-9a-fA-F]+)\}?/', '\u$1', $pattern);
|
||||
|
||||
Reference in New Issue
Block a user