framework/validators/UrlValidator.php
public function getClientOptions($model, $attribute)
    {
        if (strpos($this->pattern, '{schemes}') !== false) {
            $pattern = str_replace('{schemes}', '(' . implode('|', $this->validSchemes) . ')', $this->pattern);
        } else {
            $pattern = $this->pattern;
        }

        $options = [
            'pattern' => new JsExpression($pattern),
            'message' => $this->formatMessage($this->message, [
                'attribute' => $model->getAttributeLabel($attribute),
            ]),
            'enableIDN' => (bool) $this->enableIDN,
        ];
        if ($this->skipOnEmpty) {
            $options['skipOnEmpty'] = 1;
        }
        if ($this->defaultScheme !== null) {
            $options['defaultScheme'] = $this->defaultScheme;
        }

        return $options;
    }
public function getClientOptions($model, $attribute)
    {
        if (strpos($this->pattern, '{schemes}') !== false) {
            $pattern = str_replace('{schemes}', '(' . implode('|', $this->validSchemes) . ')', $this->pattern);
        } else {
            $pattern = $this->pattern;
        }

        $options = [
            'pattern' => new JsExpression($pattern),
            'message' => $this->formatMessage($this->message, [
                'attribute' => $model->getAttributeLabel($attribute),
            ]),
            'enableIDN' => (bool) $this->enableIDN,
        ];
        if ($this->skipOnEmpty) {
            $options['skipOnEmpty'] = 1;
        }
        if ($this->defaultScheme !== null) {
            $options['defaultScheme'] = $this->defaultScheme;
        }

        return $options;
    }
public function getClientOptions ( $ model , $ attribute ) { if ( strpos ( $ this -> pattern , '{schemes}' ) !== false ) { $ pattern = str_replace ( '{schemes}' , '(' . implode ( '|' , $ this -> validSchemes ) . ')' , $ this -> pattern ) ; } else { $ pattern = $ this -> pattern ; } $ options = [ 'pattern' => new JsExpression ( $ pattern ) , 'message' => $ this -> formatMessage ( $ this -> message , [ 'attribute' => $ model -> getAttributeLabel ( $ attribute ) , ] ) , 'enableIDN' => ( bool ) $ this -> enableIDN , ] ; if ( $ this -> skipOnEmpty ) { $ options [ 'skipOnEmpty' ] = 1 ; } if ( $ this -> defaultScheme !== null ) { $ options [ 'defaultScheme' ] = $ this -> defaultScheme ; } return $ options ; }
{@inheritdoc}
{