Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9da7f9b

Browse filesBrowse files
committed
[book] [controller] fixed the code of a session sample code
This code was updated in the past to use the $request controller injection and the resulting code was a bit confusing. When you get the attribute set by another controller, it's better to use a different attribute name, to make it clear that it wasn't set at this controller.
1 parent 9f26da8 commit 9da7f9b
Copy full SHA for 9da7f9b

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed

‎book/controller.rst

Copy file name to clipboardExpand all lines: book/controller.rst
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -666,10 +666,10 @@ from any controller::
666666
// store an attribute for reuse during a later user request
667667
$session->set('foo', 'bar');
668668

669-
// in another controller for another request
670-
$foo = $session->get('foo');
669+
// get the attribute set by another controller in another request
670+
$foobar = $session->get('foobar');
671671

672-
// use a default value if the key doesn't exist
672+
// use a default value if the attribute doesn't exist
673673
$filters = $session->get('filters', array());
674674
}
675675

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.