Download the PHP package vection-framework/validator without Composer
On this page you can find all versions of the php package vection-framework/validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vection-framework/validator
More information about vection-framework/validator
Files in vection-framework/validator
Package validator
Short Description PHP Validator for chained data validation - Vection Framework Component
License MIT
Homepage https://vection.de
Informations about the package validator
Vection Validator
PHP Validator for data and schema validation
This vection component provides a data and schema validator for PHP. You can use it from validate simple values up to big data arrays via chained validators. This component also provides a schema based validation of data structures. The flexible and open closed aspect of vection components allows to extend and modify the most classes of this component or define custom validator classes. This component can be used for the following scenarios:
- simple value validation
- data set validation by chained validators
- extend with custom validators
- schema based data structure validation
Installation
Vection Components supports only installation via composer. So first ensure your composer is installed, configured and ready to use.
Simple value validation
Data set validation by chained validators
Using custom validator implementation
Schema based data structure validation
The schema validator uses a json schema definition to validate the given data structure by json/yaml file, json/yaml strings or data array.
The base of each schema
The schema starts always with an object which must have properties and optional reusable template definitions.
String
Integer/Float
Object with fixed property names
Use @properties for fixed property names to ensure that this keys are set with an value.
Object with variable property names
Use @property for variable property names to allow multiple properties with different names but same property schema definition.
Array of properties
Use the array type to define an array property which contains elements by schema defined in @property.
Schema property validators
The schema definition can use the validators of this component to validate a schema property value.
Schema property templates
Use can use templates to reuse on different properties. The templates are defined at the root of the schema and is an object contains multiple names templates.
All versions of validator with dependencies
php Version ^7.2
ext-json Version *
ext-ctype Version *