Download the PHP package boomerang/validatr without Composer
On this page you can find all versions of the php package boomerang/validatr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download boomerang/validatr
More information about boomerang/validatr
Files in boomerang/validatr
Package validatr
Short Description Simple, multilingual, standalone PHP Validator class - Validatr.
License MIT
Homepage https://github.com/booomerang
Informations about the package validatr
Validatr
Validatr is a simple multilingual PHP Validation library for checking user's data.
- Simple form for rules and errors messages
- Flexible and extendable library with your callback rules
- Enjoyment!
Validatr is a standalone PHP class, which can be extended for your needs.
Table of contents
- Getting started
- Installation
- How to use
- Contributing
- Versioning
- Authors
- Copyright and license
Getting started
- PHP >= 5.4 is required
- Install Validatr convenient for you
- Check your data with Validatrs rules
- Enjoy!
Installation
1) Via composer
To download the library run the command:
or
2) Git clone
3) Download
Unzip it and copy the directory into your PHP project directory.
How to use
Simple Form
Form Handler with Validatr class
Set messages
//Todo
Return Values
Method validate()
returns one of two types:
AN ARRAY containing in keys names of form fields and in values nested associative array containing in keys validation rules and in values error messages. (See below example).
or
A BOOLEAN value of TRUE if the validation was successful.
Return values example:
The result may be (if all fields were sent empty):
Or if all fields was validated successfully:
Available rules:
Creating your own validating rules
For creating your own validating rules use addRule method.
Contributing
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Make your changes
- Write the unit tests for your new feature (phpunit)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
Versioning
Validatr is maintained under the Semantic Versioning guidelines. Sometimes we screw up, but we'll adhere to these rules whenever possible.
Releases will be numbered with the following format:
And constructed with the following guidelines:
- Breaking backward compatibility bumps the major while resetting minor and patch
- New additions without breaking backward compatibility bumps the minor while resetting the patch
- Bug fixes and misc changes bumps only the patch
For more information on SemVer, please visit http://semver.org/.
Brazenly copied from Bootstrap's README.md =)
Authors
Alex D.
Inspired by:
- http://jqueryvalidation.org/
- https://github.com/selahattinunlu/phpValidator
- https://github.com/Wixel/GUMP
- http://laravel.com/docs/validation
- https://github.com/Respect/Validation
Copyright and License
Copyright 2016 Alex D, licensed under the MIT.