I\'ve searched a lot on the net how to access the global $_SESSION
array from TWIG template and found this: {{app.session.get(\'index\')}}
, but whe
A simple trick is to define the $_SESSION array as a global variable. For that, edit the core.php file in the extension folder by adding this function :
public function getGlobals() {
return array(
'session' => $_SESSION,
) ;
}
Then, you'll be able to acces any session variable as :
{{ session.username }}
if you want to access to
$_SESSION['username']