Download the PHP package unicframework/validator without Composer

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

Validator

Validator is a server side data validation library for PHP. Validate html form-data, objects, arrays and json etc. Validator make data validation simple.

Installation

Set Validation Rules

We can set data validation rules using rules method.

We can also use a shorthand method to set data validation rules, which is very simple and shorter.

Set Error Messages

We can set error messages using messages method. if we don't set error messages then validator automatically generate error messages for you.

We can also use a shorthand method to set data validation rules, which is very simple and shorter.

Validate Data

Using validator we can validate html form-data, array, object and json data. Validator validate data according to rules. It will return true if all the data are valid, otherwise it will return false.

Validate single data :

Validate multiple sets of data :

Get Invalid Errors

We can get errors using errors method. the errors method return an array of errors.

Get Valid Data

We can get valid parsed data using getValidData method. the getValidData method return an array of valid data.

Get Invalid Data

We can get invalid parsed data using getInvalidData method. the getInvalidData method return an array of invalid data.

Set validation rules

Validator has a lots of predefined validation rules.

Rules Value Description
required boolean required fields check only data exists or not, it doesn't check data is empty or null.
null boolean check data is empty or null, use true for empty or null and use false for non empty or not null values.
not_null boolean check data is empty or null, use true for not null and use false for empty or null values.
alphabet boolean match alphabetical data. use true for alphabetical and false for non alphabetical values.
numeric boolean match numeric data. use true for numeric and false for non numeric values.
alphanumeric boolean match alphanumeric data. use true for alphanumeric and false for non alphanumeric values.
lowercase boolean match case of string. use true for lowercase and false for non lowercase values.
uppercase boolean match case of string. use true for uppercase and false for non uppercase values.
string boolean match string data type. use true for string and false for non string values.
integer boolean match integer data type. use true for integer and false for non integer values.
float boolean match float data type. use true for float and false for non float values.
boolean boolean match boolean data type. use true for boolean and false for non boolean values.
array boolean match array data type. use true for array and false for non array values.
object boolean match object data type. use true for object and false for non object values.
json boolean match json data type. use true for json and false for non json values.
minlength integer match minimum length of string.
maxlength integer match maximum length of string.
min integer match minimum value of number.
max integer match maximum value of number.
email boolean check given email is valid email address or not.
file boolean check data is uploaded file or not.
file_mime_type array match file mime type in given array.
file_extension array match file extension in given array.
min_file_size bytes match minimum file size.
max_file_size bytes match maximum file size.
in array match data in given array.
not_in array match data in given array.
equal mixed it will match data with given data.
not_equal mixed it will match data with given data.

Set Custom Rules

We can set predefined/custom rules for data validation. Custom rules take a callback function with one argument. If custom rule return true that means data is valid and if it will return false that means data is invalid.

License

MIT License


All versions of validator with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
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 unicframework/validator contains the following files

Loading the files please wait ....