Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitce582ec

Browse files
committed
minorsymfony#3735 [book] [controller] fixed the code of a session sample code (javiereguiluz)
This PR was merged into the 2.3 branch.Discussion----------[book] [controller] fixed the code of a session sample code| Q | A| ------------- | ---| Doc fix? | yes| New docs? | no| Applies to | 2.3+| Fixed tickets | -This code was updated in the past to use the $request controllerinjection and the resulting code was a bit confusing. When you getthe attribute set by another controller, it's better to use adifferent attribute name, to make it clear that it wasn't set atthis controller.Commits-------9da7f9b [book] [controller] fixed the code of a session sample code
2 parentsd92545e +9da7f9b commitce582ec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎book/controller.rst

Lines 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-
//inanother controllerfor another request
670-
$foo = $session->get('foo');
669+
//get the attribute set byanother controllerin another request
670+
$foobar = $session->get('foobar');
671671

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp