Download the PHP package alaa/magento2-input-validation without Composer

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

Magento Input Validation

Based on Respect Validation

Check full list of Rules

Installation

  1. Install by composer composer require alaa/magento2-input-validation
  2. Enable the module php bin/magento module:enable Alaa_RvInputValidation
  3. Magento upgrade php bin/magento setup:upgrade

Usage

1. Backend

This is very simple to use in the backend, you can use the method of your choice that suits the requirement

  1. validteInput: this will validate input with a single rule. it accepts two arguments input value as a string and a rule as an array.
  2. validate: this will validate input with multiple rules. it loops through rules and call validateInput method.
  3. validatePostData and validateGetData: this will validate multiple inputs and multiple rules for each input

The array rule elements are:

  1. class: required class name such as Email, NotEmpty, Between and etc. This is used to instantiate the validation rule object
  2. args: an optional element used to pass into the validation class constructor

Example

2. Frontend

This is very simple to use in the frontend for custom forms. Like shown in the example below, it is straight forward to learn how to apply validation. The rules here, can be either a sinle rule and a single json object or an array of rules. In the first inline method uses an array of validation rules and the second method in the init script uses a single json object to apply rules.

The validation happens on each input after clicking outside the input area, if the validation is successful it will show a basic green message. If the validation fails, then it will show a basic red message and add a new class to mark as invalid input value. Once the user fills the form, then upon submitting the form will validate and continue if validation is successful and stops if not.

The rule has rule name which is the validation class, args which are optional and name which is optional to use in the message. The validation results can be overriten by overriding the Alaa/RvInputValidation/view/frontend/web/js/rv-input-results.js

Example

Contribution

Feel free to raise issues and contribute

Licence

MIT


All versions of magento2-input-validation with dependencies

PHP Build Version
Package Version
Requires respect/validation Version ^1.1
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 alaa/magento2-input-validation contains the following files

Loading the files please wait ....