Download the PHP package jijihohococo/ichi-validation without Composer

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

Ichi Validation

Ichi Validation is the fast and secure PHP validation library.

License

This package is Open Source According to MIT license

Table of Content

Installation

Testing

Using

You can validate the input data with JiJiHoHoCoCo\IchiValidation\Validator.

For example, let's make the request which have 'name' , 'age' and 'email'.

We want to validate that 'name' is not null, 'age' must be integer and 'email' must be not null and avialable email format string

If you want to validate the data with multiple methods, you can separate methods by adding between the methods or putting those methods in the array.

Validation Methods

While validating data, the system will add the error message to this data in the validator object if this data is not passed the validation according to the related method.

To validate the data is not null or not.

To validate the data is integer or not

To validate the data is string or not

To validate the data is boolean or not

To validate the data is double or not

To validate the data is array or not

To validate the data is in the email format or not

To validate the 's parameter is null or not

To validate the uploaded file is image or not

To validate the "field" is same as "confirm_field" or not

This code is validating the "password" request is same as "confirm_password" or not

If the data is string, it is aimed to validate the number of this data string length is greater than the declared minimum number or not.

If the data is number, it is aimed to validate this number is greater than the declared minimum number or not.

If the data is uploaded file, it is aimed to validate the size of this uploaded file is greater than the declared minimum MB number or not.

If the data is string, it is aimed to validate the number of this data string length is less than the declared maximum number or not.

If the data is number, it is aimed to validate this number is less than the declared maximum number or not.

If the data is uploaded file, it is aimed to validate the size of this uploaded file is less than the declared maximum MB number or not.

To validate the data is exist in database's table or not

You must set PDO object firstly before using this method

And then you can use this method.

Above code is validating request 'email' is same as any values of 'email_field' (column) of 'user_table' (table) or not.

Validating the data with this way is used to check the data duplication while inserting new data into database.

You can also make this way to validate the same process.

Above code is validating request 'email' is same as value of 'email_field' (column) where the id is not 1 of 'user_table' (table) or not.

Validating the data with this way is used to check the data duplication while updating the data into database.

It is used where the primary key of the table is 'id'.

If the primary key of the table is not 'id', you must use the below code

To validate the uploaded file's extension is one of the specific file extensions or not

To validate the request number is between the specific two numbers or not

To validate the uploaded image is specific dimensions or not

There are sub-methods in this method.

To validate the uploaded image's width is delcared width or not

To validate the uploaded image's width is greater than the declared minimum width or not

To validate the uploaded image's width is less than the delcared maximum width or not

To validate the uploaded image's height is delcared width or not

To validate the uploaded image's height is greater than the declared minimum height or not

To validate the uploaded image's height is less than the delcared maximum height or not

Using Multiple Sub-Methods

You can validate your image's dimensions with multiple sub-methods

To validate the uploaded image width and height is same as the declared ratio

Customization

Customizing Error Message

You can customize the error message for validation

Above code is customizing the error message when the 'required' validation method is not passed.

Above code is customizing the error message when the 'required' validation method for 'name' request is not passed.

Customizing Validation Method

If you want to create your own validation method, you must create the validation class.

You can create your validation class via commandline.

Firstly you need to created the file named "ichi" under your project folder and use the below code in this file

And then you can create the validation class in your commandline

The default file folder is "app/Validations". So after making command, the validation class you created will be in the this default file folder. If you want to change the default folder path, you can change it in your "ichi" file.

You must set the accepted validation rules in your created validation class. Let's make to accept only over age 21 in this created class to validate.

In calling your validation class

It is the validation data field name. For the example, it is 'age'.

It is the data value. For the example, it is the value of 'age' request.

You can pass other values in the constructor.


All versions of ichi-validation with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0|>=8.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 jijihohococo/ichi-validation contains the following files

Loading the files please wait ....