2017 © Pedro Peláez
 

library php-form

Lightweight form validation library for PHP

image

rlanvin/php-form

Lightweight form validation library for PHP

  • Tuesday, April 12, 2016
  • by rlanvin
  • Repository
  • 4 Watchers
  • 21 Stars
  • 1,978 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 10 % Grown

The README.md

PHP Form

Lightweight form validation library for PHP, with a concise syntax and powerful use of closures. It can validate traditional form submissions as well as API requests., (*1)

Build Status Latest Stable Version, (*2)

Basic example

// create the form with rules
$form = new Form\Validator([
    'name' => ['required', 'trim', 'max_length' => 255],
    'email' => ['required', 'email']
]);

if ( $form->validate($_POST) ) {
    // $_POST data is valid
    $form->getValues(); // returns an array of sanitized values
}
else {
   // $_POST data is not valid
   $form->getErrors(); // contains the errors
   $form->getValues(); // can be used to repopulate the form
}

Complete doc is available in the wiki., (*3)

Requirements

If you are stuck with PHP 5.3, you may still use version 1.1., (*4)

Installation

The recommended way is to install the lib through Composer., (*5)

Just add this to your composer.json file:, (*6)

{
    "require": {
        "rlanvin/php-form": "2.*"
    }
}

Then run composer install or composer update., (*7)

Now you can use the autoloader, and you will have access to the library:, (*8)

<?php
require 'vendor/autoload.php';
  • Download the latest release
  • Put the files in a folder that is autoloaded, or inclure or require them

However be sure to come back regulary and check for updates., (*9)

Documentation

Complete doc is available in the wiki., (*10)

Contribution

Feel free to contribute! Just create a new issue or a new pull request., (*11)

License

This library is released under the MIT License., (*12)

The Versions

12/04 2016

dev-master

9999999-dev https://github.com/rlanvin/php-form

Lightweight form validation library for PHP

  Sources   Download

MIT

The Requires

  • ext-mbstring *
  • php >=5.4.0

 

form validation

11/04 2016

v2.0.1

2.0.1.0 https://github.com/rlanvin/php-form

Lightweight form validation library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

form validation

28/03 2016

v2.0.0

2.0.0.0 https://github.com/rlanvin/php-form

Lightweight form validation library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.4.0
  • ext-mbstring *

 

form validation

25/03 2016

v1.x-dev

1.9999999.9999999.9999999-dev https://github.com/rlanvin/php-form

Lightweight form validation library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-mbstring *

 

form validation

25/03 2016

v1.1.0

1.1.0.0 https://github.com/rlanvin/php-form

Lightweight form validation library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-mbstring *

 

form validation

12/10 2015

v1.0.0

1.0.0.0 https://github.com/rlanvin/php-form

Lightweight form validation library for PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-mbstring *

 

form validation