Download the PHP package pnhs/form_validator without Composer

On this page you can find all versions of the php package pnhs/form_validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package form_validator

Form Validator Build Status

English | Portuguese

Form Validator is an open source library for validating data received from users by forms or other means. The focus is to be simple and have an architecture compatible with the latest features of PHP.

We provide an example using "Form URL Encoded" (submission via simple HTML form) and a JSON example (submission via VUE-JS), we suggest you test both examples by doing Installation for testing, logo bellow

Help the Project to continue, donate a coffee!

Pague com PagSeguro - é rápido, grátis e seguro! or pix for brazilians: [email protected]

Installation for testing

To test before including it in your project, open the terminal, prompt or powershell and run the commands below:

Remembering that it is necessary that you have previously installed PHP and GIT.

Installation in your project

Composer

If you already know Composer (which is highly recommended), simply open the terminal, prompt or powershell in your project folder and type:

How to use

That's the best part. It couldn't be simpler, see a basic example:

Yes, just that! Just use the rules according to your need, if you wish you can contribute to the project by adding new rules. In the samples folder there are examples of using all the rules.

Supported Rules

Currently the Form Validator works with the following rules, remember you can always add more:

Rule Information Details
array
date Y-m-d standard date format If your date has another pattern for example d/m/Y, just use this way "date:d/m/Y". The return always follows the Y-m-d pattern
datetime Y-m-d H:i:s standard date format If your date has another pattern for example d/m/Y H:i:s, just use this way "date:d/m/Y H:i:s". The return always follows the pattern Y-m-d H:i:s
decimal 2 standard decimal places If you want to use a number of decimal places other than 2, use "decimal: x" , changing x to the desired number of decimal places.
email
exact:x To define the number of characters, change the x to the desired amount
integer
max_len:x
min_len:x
For min_len and max_len , change x to the desired number of characters
no_empty
numeric
required It can be empty, if you want the field to be required and not empty use both rules
string

Custom error code

You can use the # (hash) after the rule to enter the custom error code if you wish.

Future rules

*We are looking for the best way to include these rules as they change by document type, state and country.

Contribution

Every contribution is welcome. If you want to add new rules, feel free to explore the code, see how simple it is to integrate any rule into the library.

Translation

Also collaborate by including and correcting translations.

License


All versions of form_validator with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package pnhs/form_validator contains the following files

Loading the files please wait ....