Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ returned. Take this simple example from inside a controller::

$errors = $validator->validate($author);

if (count($errors) > 0) {
if ($errors->count() > 0) {
/*
* Uses a __toString method on the $errors variable which is a
* ConstraintViolationList object. This gives us a nice string
Expand Down Expand Up @@ -178,7 +178,7 @@ will appear.

You could also pass the collection of errors into a template::

if (count($errors) > 0) {
if ($errors->count() > 0) {
return $this->render('author/validation.html.twig', [
'errors' => $errors,
]);
Expand Down