From 9e6b105a830ba5e233cb923e01aa58e0c30f2a1c Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Mon, 3 Jan 2022 15:14:41 +0100 Subject: [PATCH] Explaining how to actually get the session from `Request` Question: Shouldn't `Request` be shown as preferred way (not `RequestStack`), since injecting `Request` is needed for forms anyway (whereas I've never needed to inject `RequestStack`)? --- session.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session.rst b/session.rst index 0331b964cfd..3b469bb7ff5 100644 --- a/session.rst +++ b/session.rst @@ -135,7 +135,7 @@ Check out the Symfony config reference to learn more about the other available Basic Usage ----------- -The session is available through the Request and the RequestStack. +The session is available through ``->getSession()`` from the ``Request`` and the ``RequestStack``. Symfony provides a request_stack service that is injected in your services and controllers if you type-hint an argument with :class:`Symfony\\Component\\HttpFoundation\\RequestStack`::