From 9da7f9bb09046315d749dc9a9f6d98ce83f6b4e4 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sat, 29 Mar 2014 11:19:10 +0100 Subject: [PATCH] [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. --- book/controller.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/book/controller.rst b/book/controller.rst index de17696b4a9..9ef18da08d3 100644 --- a/book/controller.rst +++ b/book/controller.rst @@ -666,10 +666,10 @@ from any controller:: // store an attribute for reuse during a later user request $session->set('foo', 'bar'); - // in another controller for another request - $foo = $session->get('foo'); + // get the attribute set by another controller in another request + $foobar = $session->get('foobar'); - // use a default value if the key doesn't exist + // use a default value if the attribute doesn't exist $filters = $session->get('filters', array()); }