1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-29 16:00:15 +02:00

Slim Framework integration #118 #117

- GlobalVars: is_logged added
This commit is contained in:
Awilum
2019-05-31 00:29:07 +03:00
parent 16c0d34db7
commit fcbfc2eede

View File

@@ -12,6 +12,8 @@
namespace Flextype;
use Flextype\Component\Session\Session;
class GlobalVarsTwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsInterface
{
/**
@@ -39,7 +41,8 @@ class GlobalVarsTwigExtension extends \Twig_Extension implements \Twig_Extension
'PATH_CONFIG_SITE' => PATH['config']['site'],
'PATH_CACHE' => PATH['cache'],
'flextype_version' => FLEXTYPE_VERSION,
'registry' => $this->flextype['registry']->dump()
'registry' => $this->flextype['registry']->dump(),
'is_logged' => ((Session::exists('role') && Session::get('role') == 'admin') ? true : false)
];
}
}