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
3eebb387157ae23271c3b0b860e91469 urivalidator-1.0.tar.gz
c490fb782b1c793c66eafedbc2beb588 urivalidator-1.0.zip
protected/extensionsIn the model:
public $uri; public function rules() { return array( array('uri', 'application.extensions.urivalidator.EUriValidator', 'mode'=>'web') ); }
/** * 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();
Total 1 comment
Works great for me and more fully featured than the inbuilt validator.
Leave a comment
Please login to leave your comment.