PHPackages                             phprest/phprest-service-validator - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. phprest/phprest-service-validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

phprest/phprest-service-validator
=================================

Phprest Validator Service.

1883PHP

Since Jun 29Pushed 10y ago1 watchersCompare

[ Source](https://github.com/phprest/phprest-service-validator)[ Packagist](https://packagist.org/packages/phprest/phprest-service-validator)[ RSS](/packages/phprest-phprest-service-validator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Phprest Validator Service
=========================

[](#phprest-validator-service)

[![Author](https://camo.githubusercontent.com/2d3fe39a5db918fba059145d397ad932c4b5a88cc66d8bcc8ad7138ca1228286/687474703a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d406164616d6d62616c6f67682d626c75652e7376673f7374796c653d666c61742d737175617265)](https://twitter.com/adammbalogh)[![Software License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Description
===========

[](#description)

Validator Service which uses the [Symfony\\Validator](https://github.com/symfony/Validator) component.

Installation
============

[](#installation)

Install it through composer.

```
{
    "require": {
        "phprest/phprest-service-validator": "@stable"
    }
}
```

**tip:** you should browse the [`phprest/phprest-service-validator`](https://packagist.org/packages/phprest/phprest-service-validator)page to choose a stable version to use, avoid the `@stable` meta constraint.

Usage
=====

[](#usage)

Configuration
-------------

[](#configuration)

For the configuration you should check the [Config](src/Config.php) class.

Registration
------------

[](#registration)

```
use Phprest\Service\Validator;
# ...
/** @var \Phprest\Application $app */

$app->registerService(new Validator\Service(), new Validator\Config());
# ...
```

Reaching from a Controller
--------------------------

[](#reaching-from-a-controller)

To reach your Service from a Controller you should use the Service's [Getter](src/Getter.php) Trait.

```
