PHP Class 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.
Since: 2.0
Author: Qiang Xue ([email protected])
Inheritance: extends Validator
Afficher le fichier Open project: yiisoft/yii2 Class Usage Examples

Méthodes publiques

Свойство Type Description
$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.

Méthodes publiques

Méthode Description
clientValidateAttribute ( $model, $attribute, $view )
init ( )
validateAttribute ( $model, $attribute )

Méthodes protégées

Méthode Description
validateValue ( $value )

Method Details

clientValidateAttribute() public méthode

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

init() public méthode

public init ( )

validateAttribute() public méthode

public validateAttribute ( $model, $attribute )

validateValue() protected méthode

protected validateValue ( $value )

Property Details

$defaultScheme public_oe property

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 public_oe property

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 public_oe property

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 public_oe property

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