File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Original file line number Diff line number Diff line change @@ -459,6 +459,10 @@ perform a 301 (permanent) redirect, modify the second argument::
459
459
460
460
return new RedirectResponse($this->generateUrl('homepage'));
461
461
462
+ You can also directly use ``redirectToRoute() `` and give it directly the route name like :
463
+
464
+ return $this->redirectToRoute('homepage');
465
+
462
466
.. index ::
463
467
single: Controller; Rendering templates
464
468
@@ -638,8 +642,13 @@ After processing the request, the controller sets a ``notice`` flash message
638
642
in the session and then redirects. The name (``notice ``) isn't significant -
639
643
it's just something you invent and reference next.
640
644
641
- In the template of the next page (or even better, in your base layout template),
642
- the following code will render the ``notice `` message:
645
+ .. tip ::
646
+
647
+ You can use the ``addFlash() `` method as a shortcut to
648
+ ``$this->get('session')->getFlashBag()->add() ``.
649
+
650
+ In the template of the next action, the following code could be used to render
651
+ the ``notice `` message:
643
652
644
653
.. configuration-block ::
645
654
You can’t perform that action at this time.
0 commit comments