Skip to content

Commit b9c298e

Browse files
committed
minor #5972 Add isSubmitted call (DanielSiepmann)
This PR was submitted for the 3.0 branch but it was merged into the 2.3 branch instead (closes #5972). Discussion ---------- Add isSubmitted call Streamline with http://symfony.com/doc/current/book/forms.html#handling-form-submissions Following best practice: http://symfony.com/doc/current/best_practices/forms.html Commits ------- d8c93e2 Add isSubmitted call
2 parents e119979 + d8c93e2 commit b9c298e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

book/forms.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ controller::
231231

232232
$form->handleRequest($request);
233233

234-
if ($form->isValid()) {
234+
if ($form->isSubmitted() && $form->isValid()) {
235235
// ... perform some action, such as saving the task to the database
236236

237237
return $this->redirect($this->generateUrl('task_success'));

0 commit comments

Comments
 (0)