File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -149,14 +149,16 @@ controllers if you type-hint an argument with
149149
150150 public function someMethod()
151151 {
152+ $session = $this->requestStack->getSession();
153+
152154 // stores an attribute in the session for later reuse
153- $this->requestStack->getSession() ->set('attribute-name', 'attribute-value');
155+ $session ->set('attribute-name', 'attribute-value');
154156
155157 // gets an attribute by name
156- $foo = $this->requestStack->getSession() ->get('foo');
158+ $foo = $session ->get('foo');
157159
158160 // the second argument is the value returned when the attribute doesn't exist
159- $filters = $this->requestStack->getSession() ->get('filters', []);
161+ $filters = $session ->get('filters', []);
160162
161163 // ...
162164 }
You can’t perform that action at this time.
0 commit comments