Skip to content

Commit 65324f3

Browse files
committed
minor #11539 [Session] Fix local variable in session example (Einenlum)
This PR was merged into the 4.2 branch. Discussion ---------- [Session] Fix local variable in session example Fixes this code example: https://symfony.com/doc/current/session.html#basic-usage (`$session` -> `$this->session`) Commits ------- 95fd311 Fix local variable in session example
2 parents 4b4385b + 95fd311 commit 65324f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

session.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,13 @@ controllers if you type-hint an argument with
146146
public function someMethod()
147147
{
148148
// stores an attribute in the session for later reuse
149-
$session->set('attribute-name', 'attribute-value');
149+
$this->session->set('attribute-name', 'attribute-value');
150150

151151
// gets an attribute by name
152-
$foo = $session->get('foo');
152+
$foo = $this->session->get('foo');
153153

154154
// the second argument is the value returned when the attribute doesn't exist
155-
$filters = $session->get('filters', []);
155+
$filters = $this->session->get('filters', []);
156156

157157
// ...
158158
}

0 commit comments

Comments
 (0)