PHPackages                             atasciuc/zend-expressive-validation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. atasciuc/zend-expressive-validation

ActiveLibrary[HTTP &amp; Networking](/categories/http)

atasciuc/zend-expressive-validation
===================================

PSR-7 Validation middleware for zend-expressive

1.0.1(10y ago)13413BSD-3-ClausePHPPHP ^5.5 || ^7.0

Since Jan 15Pushed 9y ago1 watchersCompare

[ Source](https://github.com/atasciuc/zend-expressive-validation)[ Packagist](https://packagist.org/packages/atasciuc/zend-expressive-validation)[ RSS](/packages/atasciuc-zend-expressive-validation/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (22)Versions (3)Used By (0)

Expressive Validator
====================

[](#expressive-validator)

Validation library for the zend-expressive ()

Installation
------------

[](#installation)

Using composer!

```
composer require atasciuc/zend-expressive-validation
```

Usage
-----

[](#usage)

### 1. ----

[](#1-----)

Create a validator factory

```
/**
 * Instantiates the validator
 * Class YourValidatorFactoryClass
 */
class YourValidatorFactoryClass
{
    public function __invoke(ContainerInterface $container)
    {
        /** @var EntityManagerInterface $entityManager */
        $entityManager = $container->get('orm.default'); // = null
        return new Validator(
            $container->get(OptionsExtractor::class),
            $container->get(RouterInterface::class),
            $entityManager
        );
    }
}
```

Note:
-----

[](#note)

The entityManager is optional and required only if you want to use database validation classes such as `EntityExist`

### 2. ----

[](#2-----)

Add the validator classes to the `dependecies.php` of your project

```
