Skip to content

Commit 471038c

Browse files
authored
Fixed the use of Session with RequesStack
$this->session is never instanciated. We have to use $this->requestStack->getSession() instead
1 parent 7f17991 commit 471038c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

session.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ controllers if you type-hint an argument with
153153
$this->requestStack->getSession()->set('attribute-name', 'attribute-value');
154154

155155
// gets an attribute by name
156-
$foo = $this->session->get('foo');
156+
$foo = $this->requestStack->getSession()->get('foo');
157157

158158
// the second argument is the value returned when the attribute doesn't exist
159-
$filters = $this->session->get('filters', []);
159+
$filters = $this->requestStack->getSession()->get('filters', []);
160160

161161
// ...
162162
}

0 commit comments

Comments
 (0)