No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
README.md
Validaro.php

README.md

Validaro

Validaro is a simple PHP form validation plugin that allows you to keep cleaner code with more efficient form validation. Validaro allows for an easier way to read what properties you are trying to validate for each value.

Installation

The only file you need is "Validaro.php". Place this file wherever you like in your project and reference it with your method of choice.

Basic Usage

In order to use any of the functions within Validaro you need to first create an variable array. This array will hold all the values that you wish to validate. This array can be as long as you like.

$data = array(
    array(
        'field' => $_POST['name'],
        'maxLength' => 32,
        'minLength' => 6,
        'required' => true
    ),
    array (
        'field' => $_POST['email'],
        'maxLength' => 32,
        'minLength' => 6,
        'required' => true
    )
)

After defining what you wish to validate you can then use one of the built in functions to check what you wish.

if (Validaro::checkNotEmpty($data)) {
    //Do Something
}

##Functions All functions will return either a true or false value allowing you to use them in a conditional statement.

if (Validaro::checkNotEmpty($data)) {
    //Do something
}

Checks that all required fields with are not empty.

Validaro::checkNotEmpty();

Checks that all fields match your supplied "maxLength" value.

Validaro::checkMaxLength();

Checks that all fields match your supplied "minLength" value.

Validaro::checkMinLength();

License

MIT