urivalidator URI Validator

  1. Documentation
  2. Change Log

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.
2 0
1 follower
1 157 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Validation
Tags:
Developed by: MetaYii
Created on: Dec 28, 2008
Last updated: 15 years ago

Downloads

show all