2017 © Pedro Peláez
 

library validbit

ValidBit is an easy and simple PHP validation library

image

amitkhare/validbit

ValidBit is an easy and simple PHP validation library

  • Wednesday, September 27, 2017
  • by amitkhare
  • Repository
  • 1 Watchers
  • 1 Stars
  • 130 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 7 Versions
  • 2 % Grown

The README.md

amitkhare/validbit

Validbit is an easy to use PHP validation library, (*1)

This package is abandoned and no longer maintained. Use https://github.com/amitkhare/easy-validation package instead.

Install

Run this command from the directory in which you want to install., (*2)

Via Composer:

php composer.phar require amitkhare/validbit

Via Git:

git clone https://github.com/amitkhare/validbit.git

Manual Install:

Download: https://github.com/amitkhare/validbit/archive/master.zip
Extract it, require "PATH-TO/"."validbit.php" where you want to use it.

Usage:

<?php
use AmitKhare\ValidBit; // use namespace.

require("PATH-TO/"."validbit.php"); // only need to include if installed manually.

$v = new ValidBit(); // instantiate ValidBit;

//  OR with database for unique field check
$v = new ValidBit($host,$username,$password,$dbname); // instantiate ValidBit With Database features;

$v->setSource($_POST); // set data source array;

$v->check("mobile","required|numeric|min:10|max:15");
$v->check("username","required|alphanum|unique:users.username|min:4|max:20");
$v->check("email","required|email|unique:users.email|min:4|max:100");

$v->match("password","password_confirm","required|min:6|max:25");

if(!$v->isValid()){
    print_r($v->getStatus());
}

Available Methods:

> $v->check("FIELD","RULES");
> $v->match("FIELD1","FIELD2","RULES");

Available Rules:

> required
> email
> url
> numeric
> string
> float
> ipv4
> ipv6
> bool
> min
> max
> alphanum
> alphanumUnicode
> unique (avaiable only if instantiate ValidBit With Database);

The Versions

27/09 2017

dev-master

9999999-dev http://github.com/amitkhare/validbit

ValidBit is an easy and simple PHP validation library

  Sources   Download

MIT

by Amit Kumar Khare

08/05 2016

0.2.5

0.2.5.0 http://github.com/amitkhare/validbit

ValidBit is an easy and simple PHP validation library

  Sources   Download

MIT

by Amit Kumar Khare

08/05 2016

0.2.4

0.2.4.0 http://github.com/amitkhare/validbit

ValidBit is an easy and simple PHP validation library

  Sources   Download

MIT

by Amit Kumar Khare

08/05 2016

0.2.3

0.2.3.0 http://github.com/amitkhare/validbit

ValidBit is an easy and simple PHP validation library

  Sources   Download

MIT

by Amit Kumar Khare

08/05 2016

0.2.2

0.2.2.0 http://github.com/amitkhare/validbit

ValidBit is an easy and simple PHP validation library

  Sources   Download

MIT

by Amit Kumar Khare

08/05 2016

0.2.1

0.2.1.0 http://github.com/amitkhare/validbit

ValidBit is an easy and simple PHP validation library

  Sources   Download

MIT

by Amit Kumar Khare

06/05 2016

0.1.3

0.1.3.0 http://github.com/amitkhare/validbit

ValidBit is an easy and simple PHP validation library

  Sources   Download

MIT

by Amit Kumar Khare