From 72c5d5244fc2456e6592cb10837c6c1aa7992189 Mon Sep 17 00:00:00 2001 From: DorsetDigital Date: Fri, 9 Mar 2018 20:03:46 +0000 Subject: [PATCH] Update 02_Sessions.md Add additional 'use' statement (for Injector) in example of getting a session outside a controller. --- .../02_Developer_Guides/18_Cookies_And_Sessions/02_Sessions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/02_Developer_Guides/18_Cookies_And_Sessions/02_Sessions.md b/docs/en/02_Developer_Guides/18_Cookies_And_Sessions/02_Sessions.md index 347d87825..fade2443c 100644 --- a/docs/en/02_Developer_Guides/18_Cookies_And_Sessions/02_Sessions.md +++ b/docs/en/02_Developer_Guides/18_Cookies_And_Sessions/02_Sessions.md @@ -30,6 +30,7 @@ Otherwise, if you're not in a controller, get the request as a service. ```php use SilverStripe\Control\HTTPRequest; +use SilverStripe\Core\Injector\Injector; $request = Injector::inst()->get(HTTPRequest::class); $session = $request->getSession();