antkowiak / validation-bundle
Symfony AntkowiakValidationBundle
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^5.5.9|^7.0
This package is not auto-updated.
Last update: 2025-05-02 22:20:04 UTC
README
Step 1: Composer require
composer require antkowiak/validation-bundle dev-master
Step 2: Enable the bundle
new Antkowiak\ValidationBundle\AntkowiakValidationBundle()
Usage
$validator = $this->get('antkowiak.validator');
$object = new Object(); //Object with assert on fields.
$object->setEmail('1');
$validator->isValid($object); //boolean
$validator->getMessages($object); //array with messages
Example messages array:
array:2 [
"user" => array:1 [
0 => "Ta wartość nie powinna być pusta."
]
"name" => array:2 [
0 => "Ta wartość nie jest prawidłowym adresem email."
1 => "Ta wartość jest zbyt krótka. Powinna mieć 3 lub więcej znaków."
]
]
License
This bundle is released under the MIT license. See the complete license in the bundle:
Resources/meta/LICENSE