Skip to content
This repository has been archived by the owner on Jul 4, 2018. It is now read-only.

Commit

Permalink
Update validator.rst
Browse files Browse the repository at this point in the history
Example from documentation throws `Call to undefined method Symfony\Component\Validator\Validator\RecursiveValidator::validateValue()`
  • Loading branch information
yourwebmaker committed Dec 22, 2015
1 parent bf071d4 commit 04ecee2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/providers/validator.rst
Expand Up @@ -49,13 +49,13 @@ The Validator provider provides a ``validator`` service.
Validating Values
~~~~~~~~~~~~~~~~~

You can validate values directly using the ``validateValue`` validator
You can validate values directly using the ``validate`` validator
method::

use Symfony\Component\Validator\Constraints as Assert;

$app->get('/validate/{email}', function ($email) use ($app) {
$errors = $app['validator']->validateValue($email, new Assert\Email());
$errors = $app['validator']->validate($email, new Assert\Email());

if (count($errors) > 0) {
return (string) $errors;
Expand Down Expand Up @@ -99,7 +99,7 @@ collection of constraints::
'last_name' => new Assert\Length(array('min' => 10)),
)),
));
$errors = $app['validator']->validateValue($book, $constraint);
$errors = $app['validator']->validate($book, $constraint);

if (count($errors) > 0) {
foreach ($errors as $error) {
Expand Down

0 comments on commit 04ecee2

Please sign in to comment.