Download the PHP package raisins/validation without Composer

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

Simple PHP lib for Validation

Composer Installation

  1. Get Composer
  2. Require Raisins Validation with composer require raisins/validation
  3. Add the following to your application's main PHP file: require 'vendor/autoload.php';

Usage

Add errors message in your language

Origilal errors message array

Methods

Method Parameter Description Example
name $name Return field name name('name')
value $value Return value field value($_POST['name])
file $value Return $_FILES array file($_FILES['name'])
pattern $pattern Return an error if the input has a different format than the pattern pattern('text')
customPattern $pattern Return an error if the input has a different format than the custom pattern customPattern('[A-Za-z]')
required Returns an error if the input is empty required()
min $length Return an error if the input is shorter than the parameter min(10)
max $length Return an error if the input is longer than the parameter max(10)
equal $value Return an error if the input is not same as the parameter equal($value)
maxSize $value Return an error if the file size exceeds the maximum allowable size maxSize(3145728)
ext $value Return an error if the file extension is not same the parameter ext('pdf')
isSuccess Return true if there are no errors isSuccess()
getErrors Return an array with validation errors getErrors()
displayErrors Return Html errors displayErrors()
result Return true if there are no errors or html errors result()
is_int $value Return true if the value is an integer number is_int(1)
is_float $value Return true if the value is an float number is_float(1.1)
is_alpha $value Return true if the value is an alphabetic characters is_alpha('test')
is_alphanum $value Return true if the value is an alphanumeric characters is_alphanum('test1')
is_url $value Return true if the value is an url (protocol is required) is_url('http://www.example.com')
is_uri $value Return true if the value is an uri (protocol is not required) is_uri('www.example.com')
is_bool $value Return true if the value is an boolean is_bool(true)
is_email $value Return true if the value is an e-mail is_email('[email protected]')

Patterns

Name Description Example
uri Url without file extension folder-1/folder-2
url Uri with file extension http://www.example.com/myfile.gif
alpha Only alphabetic characters World
words Alphabetic characters and spaces Hello World
alphanum Alpha-numeric characters test2016
int Integer number 154
float Float number 1,234.56
tel Telephone number (+39) 081-777-77-77
text Alpha-numeric characters, spaces and some special characters Test1 ,.():;!@&%?
file File name format myfile.png
folder Folder name format my_folde
address Address format Street Name, 99
date_dmy Date in format dd-MM-YYYY 01-01-2016
date_ymd Date in format YYYY-MM-dd 2016-01-01
email E-Mail format [email protected]

All versions of validation with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2
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 raisins/validation contains the following files

Loading the files please wait ....