File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
Original file line number Diff line number Diff line change @@ -130,9 +130,9 @@ simple example from inside a controller::
130
130
131
131
if (count($errors) > 0) {
132
132
return new Response(print_r($errors, true));
133
- } else {
134
- return new Response('The author is valid! Yes!');
135
133
}
134
+
135
+ return new Response('The author is valid! Yes!');
136
136
}
137
137
138
138
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.
161
161
return $this->render('AcmeBlogBundle:Author:validate.html.twig', array(
162
162
'errors' => $errors,
163
163
));
164
- } else {
165
- // ...
166
- }
164
+ }
167
165
168
166
Inside the template, you can output the list of errors exactly as needed:
169
167
@@ -655,7 +653,7 @@ Now, create the ``isPasswordLegal()`` method, and include the logic you need::
655
653
656
654
public function isPasswordLegal()
657
655
{
658
- return ( $this->firstName != $this->password) ;
656
+ return $this->firstName != $this->password;
659
657
}
660
658
661
659
.. note ::
You can’t perform that action at this time.
0 commit comments