ipvalidator IP Syntax Validation (ipv4/ipv6)

  1. Documentation
  2. Change Log

IPValidator checks if an IP address is technically correct.

Documentation

Requirements
  • Yii 1.0 or above
Installation
  • Extract the release file under protected/extensions
Usage

The following model code validates against the ipv4 regex:

public function rules()
{
   return array(
      array('ipAddr', 'application.extensions.ipvalidator.IPValidator', 'version' => 'v4')
           );
}

While the following validates against the ipv6 regex: [php] public function rules() { return array(

  array('ipAddr', 'application.extensions.ipvalidator.IPValidator', 'version' => 'v4')
       );

}

Change Log

1.1 - ipv4 bug fixed (Thanks to beesnept)

- ipv6 support added (Thanks to Rich Brown for his regex)

1.0 - initial version

4 0
4 followers
1 768 downloads
Yii Version: 1.1
License: (not set)
Category: Validation
Tags:
Developed by: eval
Created on: Nov 26, 2008
Last updated: 14 years ago

Downloads

show all