Download the PHP package softxpert/magento1-validator without Composer

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

Magento Validator

Laravel like Magento 1.x validator.

Release License

Magento validator is a validation service to validate inputs for requests. It depends on Zend validation classes, for more information about these validation rules visit Zend Documentation

Table of Contents

  1. Getting Started
    • Installation
    • How To
  2. Rules And Methods
    • Available Rules
    • Available Methods
  3. Contributing
  4. License
  5. Change Logs

Getting Started

Installation

Require the Magento validator via composer

This isntallation will install modman package to map Magento files from the vendor directory.

Execute the following commands to map the module files into your Magento project

Finally we are done, and you'll find the module files under app/code/community/Softxpert/Validator directory.

How To

To validate a request you have 2 ways:

Inline Validation

It supports nested inputs too.

Observer Validator

Create an observer for that particular route and handle all your request validations.

For more example usage, visit the ValidationsTest class.

Rules And Methods

Available Validation Rules

alpha

String under alpha rule must consist of alphabetic characters.

alpha_num

String under alpha_num rule must consist of alphabetic and numeric characters.

between:min,max

Validates a given value to be between min and max values.

break

Break chain of rules on the first failure.

date:format

Validates the given value to equal to a given date format. If format is not given, then the default format (yyyy-mm-dd) will be used.

digits

Validates a given value to be numeric.

email

Validates a given value to be an email.

even

Validate a given value to be an even number.

extensions:jpg,png,txt,...

Allowed extensions for a particular file input field.

float

Validates a given value to be float.

gt:min

Validates the given value to be greater than a min value.

integer

Validates a given value to be an integer.

image

The file under validation must be an image (jpeg, png, bmp, gif, ...)

in:foo,bar...

Validates that a given value is one of the provided options.

ipv4

Validates the given value to be an IP v4 address.

lt:max

Validates the given value to be less than a max value.

nullable

Field under validation is allowed to be null/empty.

odd

Validates a given value to be odd number.

regex:pattern

Validates the given string to match a given pattern. Eg: regex:/^Test/

required

Field under validation is required.

string

Validates that the given value is a string.

str_extension:txt,log,...

Validates that the given file name is in the provided extension set (no MIME type checks).

str_size:min,max

String size validates a string size with min and max values. If min and max are not provided, then the rule validates the value as a string. If only min is provided, then the rule validates the minimum string length with unlimited maximum length.

zip_code:locale

Validates the value to be a postal zip code. Locale must be provided. Eg: zip_code:ar_EG

Available Methods

validate

Prepare the validator with data and rules.

isValid

Checks whether the data are valid or not. If $fieldName is provided, then the validation would be applied only on this field.

fails

Checks whether the data fails the validation or not. If $fieldName is provided, then the validation would be applied only on this field.

getMessages

Return validation error messages array under errors error bag.

getMessagesTemplate

Return validation error messages in an HTML un-ordered list block.

redirectOnFailure

End request and return with error messages on validation failure. This method supports both, redirecting to an HTML page with session error messages or JSON response. If $redirectTo is not specified, then the request will redirect to the previous page.

noChain

Determine whether the validation errors should break and return on the first in-valid rule, or return a complete set of error messages

Contributing

Please, read CONTRIBUTING.md for details on the process for submitting pull requests to us.

License

This project is licensed under the MIT License - see the LICENSE file for details

ChangeLog

Please, read the CHANGELOG.md for more details about releases updates.


All versions of magento1-validator with dependencies

PHP Build Version
Package Version
Requires colinmollenhour/modman Version 1.12
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 softxpert/magento1-validator contains the following files

Loading the files please wait ....