Created
July 28, 2015 10:26
-
-
Save tvlooy/120189a941955dca4922 to your computer and use it in GitHub Desktop.
Symfony validator without entities or objects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// See http://symfony.com/doc/current/book/validation.html#validating-values-and-arrays | |
$email = $app['request']->get('email'); | |
$emailConstraint = new \Symfony\Component\Validator\Constraints\Email(); | |
$emailConstraint->message = 'Invalid email address'; | |
$errorList = $val->validate( | |
$email, | |
$emailConstraint | |
); | |
var_dump($errorList); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment