blob: 77b5b55a2389ac575a7b64bc3eca21a9e0424a38 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
<?php
namespace Engelsystem\Renderer\Twig\Extensions;
use Symfony\Component\HttpFoundation\Session\Session as SymfonySession;
use Twig\Extension\AbstractExtension as TwigExtension;
use Twig\TwigFunction;
class Session extends TwigExtension
{
/** @var SymfonySession */
protected $session;
/**
* @param SymfonySession $session
*/
public function __construct(SymfonySession $session)
{
$this->session = $session;
}
/**
* @return TwigFunction[]
*/
public function getFunctions(): array
{
return [
new TwigFunction('session_get', [$this->session, 'get']),
];
}
}
|