Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sokil/php-symfony-validator-converter
https://github.com/sokil/php-symfony-validator-converter
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/sokil/php-symfony-validator-converter
- Owner: sokil
- License: mit
- Created: 2016-08-08T08:47:40.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-28T12:48:29.000Z (over 7 years ago)
- Last Synced: 2024-10-09T21:00:04.594Z (about 1 month ago)
- Language: PHP
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# php-symfony-validator-converter
## Installation
Add requirement to composer:
```
composer require sokil/php-symfony-validator-converter
```Add service to app or bundle services config:
```
acme.validator.error_converter:
class: Sokil\Converter\ValidationErrorsConverter
```## Usage
```php
get('validator')->validate($entity);
if (count($errors) > 0) {
$list = $this
->get('acme.validator.error_converter')
->constraintViolationListToArray($errors);
}
```