Skip to content

Commit 36f89d3

Browse files
beesoftsweaverryan
authored andcommitted
Update cookbook/doctrine/file_uploads.rst
$this->redirect(...) must be returned
1 parent ea5e1b2 commit 36f89d3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cookbook/doctrine/file_uploads.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ The following controller shows you how to handle the entire process::
165165
$em->persist($document);
166166
$em->flush();
167167

168-
$this->redirect($this->generateUrl(...));
168+
return $this->redirect($this->generateUrl(...));
169169
}
170170
}
171171

@@ -203,7 +203,7 @@ in a moment to handle the file upload::
203203
$em->persist($document);
204204
$em->flush();
205205

206-
$this->redirect(...);
206+
return $this->redirect(...);
207207
}
208208

209209
The ``upload()`` method will take advantage of the :class:`Symfony\\Component\\HttpFoundation\\File\\UploadedFile`
@@ -323,7 +323,7 @@ call to ``$document->upload()`` should be removed from the controller::
323323
$em->persist($document);
324324
$em->flush();
325325

326-
$this->redirect(...);
326+
return $this->redirect(...);
327327
}
328328

329329
.. note::

0 commit comments

Comments
 (0)