Download the PHP package mvlabs/ze-content-validation without Composer
On this page you can find all versions of the php package mvlabs/ze-content-validation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mvlabs/ze-content-validation
More information about mvlabs/ze-content-validation
Files in mvlabs/ze-content-validation
Package ze-content-validation
Short Description PSR-7 Validation middleware for Zend Expressive
License MIT
Informations about the package ze-content-validation
Zend Expressive Content Validation
Introduction
Zend Expressive Content Validation is a Middleware for automating validation of incoming input.
Allows the following:
- Defining named input filters.
- Mapping named input filters to routes.
- Returning a PSR-7 response representation of application/problem with validation error messages on invalid input using Zend Problem Details
Installation
Run the following composer
command:
Configuration
The ze-content-validation key is a mapping between routes names as the key, and the value being an array of
mappings that determine which HTTP method to respond to and what input filter to map to for the given request.
The keys for the mapping can either be an HTTP method or *
wildcard for applying to any http method.
Example:
In the above example, the \App\InputFilter\UserInputFilter will be selected for POST requests.
input_filter_spec
input_filter_spec
is for configuration-driven creation of input filters. The keys for this array
will be a unique name, but more often based off the service name it is mapped to under the
ze-content-validation
key. The values will be an input filter configuration array, as is
described in the ZF2 manual section on input
filters.
Example:
Validating
In the following request, an email value is provided with an invalid format, and the displayName field is omitted entirely:
The response:
All versions of ze-content-validation with dependencies
roave/security-advisories Version dev-master
zendframework/zend-expressive Version ^3.0
zendframework/zend-filter Version ^2.8
zendframework/zend-http Version ^2.7
zendframework/zend-inputfilter Version ^2.8
zendframework/zend-servicemanager Version ^3.3
zendframework/zend-stdlib Version ^3.1
zendframework/zend-validator Version ^2.10
zendframework/zend-i18n Version ^2.7
zendframework/zend-problem-details Version ^1.0
zf2timo/zf-mvc-expressive-bridge Version ^1.0