mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 09:44:55 +02:00
Twig session(key) function + reworked session functions to accept multi-array like in Laravel
Important: getSession returns NULL now instead of false if session value not found
This commit is contained in:
@@ -140,6 +140,11 @@ $function = new TwigFunction('csrfToken', function () {
|
||||
});
|
||||
$twig->addFunction($function);
|
||||
|
||||
$function = new TwigFunction('session', function ($key) {
|
||||
return session($key);
|
||||
});
|
||||
$twig->addFunction($function);
|
||||
|
||||
$filter = new TwigFilter('urlencode', function ($s) {
|
||||
return urlencode($s);
|
||||
});
|
||||
|
Reference in New Issue
Block a user