EUriValidator is a validator which uses regular expresions and other checks to validate an URI according to RFC 3986 and related RFCs, and see if it is well formed.
Current version: 1.0
File checksums: ¶
3eebb387157ae23271c3b0b860e91469 urivalidator-1.0.tar.gz
c490fb782b1c793c66eafedbc2beb588 urivalidator-1.0.zip
Resources ¶
Documentation ¶
Requirements ¶
- Yii 1.0 or above
Installation ¶
- Extract the release file under
protected/extensions
Usage ¶
In the model:
public $uri;
public function rules()
{
return array(
array('uri', 'application.extensions.urivalidator.EUriValidator', 'mode'=>'web')
);
}
Configuration parameters ¶
/**
* The validation can:
*
* - uri: check if an URI is well formed, as far and strictly as possible.
* - web: check if an URI is well formed, real world WWW URI (http or https).
* - mail: check if an URI is well formed, real world mailto: URI.
*
* @var string
*/
private $mode = 'uri';
/**
* Whetever to allow empty URIs
*
* @var boolean
*/
private $allowEmptyURI = true;
/**
* Should we validate the schema against the IANA registered schemas?
*
* @var boolean
*/
private $validateIANA = true;
/**
* Should we validate if the port is between 0 and 65535?
*
* @var boolean
*/
private $validatePortRange = true;
/**
* The user can define which schemes are valid,
* for example array('http','ftp')
*
* @var array of string
*/
private $customSchemes = array();
/**
* The user can define which ports are valid,
* for example array(80,21)
*
* @var array of integer
*/
private $customPorts = array();
Change Log ¶
December 28, 2008 ¶
- Version 1.0: Initial release.
Works fine.
Works great for me and more fully featured than the inbuilt validator.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.