8000 Update validation.rst · programaths/symfony-docs@e4ecb50 · GitHub
[go: up one dir, main page]

Skip to content

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

Appearance settings

Commit e4ecb50

Browse files
cordovalweaverryan
authored andcommitted
Update validation.rst
1 parent cd6fc62 commit e4ecb50

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

book/validation.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ simple example from inside a controller::
130130

131131
if (count($errors) > 0) {
132132
return new Response(print_r($errors, true));
133-
} else {
134-
return new Response('The author is valid! Yes!');
135133
}
134+
135+
return new Response('The author is valid! Yes!');
136136
}
137137

138138
If the ``$name`` property is empty, you will see the following error
@@ -161,9 +161,7 @@ You could also pass the collection of errors into a template.
161161
return $this->render('AcmeBlogBundle:Author:validate.html.twig', array(
162162
'errors' => $errors,
163163
));
164-
} else {
165-
// ...
166-
}
164+
}
167165
168166
Inside the template, you can output the list of errors exactly as needed:
169167

@@ -655,7 +653,7 @@ Now, create the ``isPasswordLegal()`` method, and include the logic you need::
655653

656654
public function isPasswordLegal()
657655
{
658-
return ($this->firstName != $this->password);
656+
return $this->firstName != $this->password;
659657
}
660658

661659
.. note::

0 commit comments

Comments
 (0)
0