Created
December 5, 2014 14:28
-
-
Save jverdeyen/9075b2b736bcac08ef86 to your computer and use it in GitHub Desktop.
Symfony2 validate form without submit
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
$errors = $this->get('validator')->validate($user, array('user')); | |
foreach ($errors as $error) { | |
$form->get($error->getPropertyPath())->addError(new FormError($error->getMessage())); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment