Download the PHP package romagny13/php-validator without Composer
On this page you can find all versions of the php package romagny13/php-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package php-validator
PHP Validator
Installation
Presentation
Validation classes (extends Validation base class) => with message (error message) and __invoke (magic function) to validate the received value:
- RequiredValidation
- MinLengthValidation
- MaxLengthValidation
- PatternValidation
- EmailValidation
- CustomValidation
Services:
- ValidationStrategy (implements ValidationStrategyInterface) => returns Validation class instances (RequiredValidation, MinLengthValidation, etc.)
- ValidationService (implements ValidationServiceInterface) => allows to register validations by models and validate model values
Helpers:
- Validations => Provides shortcuts (static functions) to create instances of Validations (required, minLength, maxLength, pattern, email, custom)
- Validator => Allows to validate easily (static functions) a model with validations (valide model and validateValue)
Example
Extend
Create a class that inherits from 'Validation'.
Extend Validators class helper
Usage (example with age)
ValidationService
A better way to use validation from a service class for example and have a code more testable.
Example :
Create a service that receive the ValidationService to use.
Usage
All versions of php-validator with dependencies
PHP Build Version
Package Version
No informations.
The package romagny13/php-validator contains the following files
Loading the files please wait ....