PHP Класс yii\validators\UrlValidator

Note that this validator only checks if the URL scheme and host part are correct. It does not check the remaining parts of a URL.
С версии: 2.0
Автор: Qiang Xue ([email protected])
Наследование: extends Validator
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$defaultScheme the default URI scheme. If the input doesn't contain the scheme part, the default scheme will be prepended to it (thus changing the input). Defaults to null, meaning a URL must contain the scheme part.
$enableIDN whether validation process should take into account IDN (internationalized domain names). Defaults to false meaning that validation of URLs containing IDN will always fail. Note that in order to use IDN validation you have to install and enable intl PHP extension, otherwise an exception would be thrown.
$pattern the regular expression used to validate the attribute value. The pattern may contain a {schemes} token that will be replaced by a regular expression which represents the [[validSchemes]].
$validSchemes list of URI schemes which should be considered valid. By default, http and https are considered to be valid schemes.

Открытые методы

Метод Описание
clientValidateAttribute ( $model, $attribute, $view )
init ( )
validateAttribute ( $model, $attribute )

Защищенные методы

Метод Описание
validateValue ( $value )

Описание методов

clientValidateAttribute() публичный Метод

public clientValidateAttribute ( $model, $attribute, $view )

init() публичный Метод

public init ( )

validateAttribute() публичный Метод

public validateAttribute ( $model, $attribute )

validateValue() защищенный Метод

protected validateValue ( $value )

Описание свойств

$defaultScheme публичное свойство

the default URI scheme. If the input doesn't contain the scheme part, the default scheme will be prepended to it (thus changing the input). Defaults to null, meaning a URL must contain the scheme part.
public $defaultScheme

$enableIDN публичное свойство

whether validation process should take into account IDN (internationalized domain names). Defaults to false meaning that validation of URLs containing IDN will always fail. Note that in order to use IDN validation you have to install and enable intl PHP extension, otherwise an exception would be thrown.
public $enableIDN

$pattern публичное свойство

the regular expression used to validate the attribute value. The pattern may contain a {schemes} token that will be replaced by a regular expression which represents the [[validSchemes]].
public $pattern

$validSchemes публичное свойство

list of URI schemes which should be considered valid. By default, http and https are considered to be valid schemes.
public $validSchemes