Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1a425cc

Browse files
committed
[symfony#3229] Adding some additional notes so it doesn't look like magic
1 parentb535d86 commit1a425cc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎book/validation.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,14 @@ simple example from inside a controller::
129129
$errors = $validator->validate($author);
130130

131131
if (count($errors) > 0) {
132-
return new Response($errors);
132+
/*
133+
* Uses a __toString method on the $errors variable which is a
134+
* ConstraintViolationList object. This gives us a nice string
135+
* for debugging
136+
*/
137+
$errorsString = (string) $errors;
138+
139+
return new Response($errorsString);
133140
}
134141

135142
return new Response('The author is valid! Yes!');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp