Download the PHP package bootpress/validator without Composer

On this page you can find all versions of the php package bootpress/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 validator

use BootPress\Validator\Component as Validator;

Packagist HHVM Tested PHP 7 Supported Build Status Code Climate Test Coverage

Form validation that is designed to simplify and work seamlessly with Jörn's jQuery Validation Plugin. All of the validation routines are designed to match (as closely as possible) those provided by Jörn, so that the browser and server validation routines are in sync with one another.

Installation

Add the following to your composer.json file.

Example Usage

The first thing you need to do is give us an array of values to validate against. In this case you have given us the $_POST vars. Now you can set the rules and filters for each field.

Field names can be an array by adding brackets to the end ie. 'name[]'. They can also be multi-dimensional arrays such as 'name[first]', or 'name[players][]', or 'name[parent][child]', etc. The important thing to remember is that you must always use the exact name given here when referencing them in other methods.

Rules and filters are either '|' (single pipe) delimited, or you can make them an array. Custom messages can be specified by making it an array($rule => $message, ...). Parameters are comma-delimited, and placed within '[]' two brackets. The available options are:

To see if the $_POST array you gave us meets all of your requirements:

The $vars returned are all trim()ed and filtered, ready for you to process as you see fit. From here, the best thing to do is use our BootPress Form Component, but if you have any better ideas then you can determine whether or not the $validator->required('field'), get the submitted $validator->value('field'), check if there was a $validator->error('field'), get the data-rule-... $validator->rules('field') attributes, and the data-msg-... $validator->messages('field') attributes, find the $validator->id('field') we assigned, and set the $validator->jquery('#form') javascript when creating your form and fields.

All of the above is just assuming you are using this component to validate submitted form data, but it is equally well suited to validate anything on the side as well. The static methods we provide (and use ourselves) are:

The value you want to validate always comes first, and any parameters come second - lest you be confused.

License

The MIT License (MIT). Please see License File for more information.


All versions of validator with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
bootpress/page Version ^1.0
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 bootpress/validator contains the following files

Loading the files please wait ....