summaryrefslogtreecommitdiff
path: root/src/Renderer/Twig/Extensions/Config.php
blob: dbbe93e7c968111ebf55df339cd8803c0b162464 (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 Engelsystem\Config\Config as EngelsystemConfig;
use Twig_Extension as TwigExtension;
use Twig_Function as TwigFunction;

class Config extends TwigExtension
{
    /** @var EngelsystemConfig */
    protected $config;

    /**
     * @param EngelsystemConfig $config
     */
    public function __construct(EngelsystemConfig $config)
    {
        $this->config = $config;
    }

    /**
     * @return TwigFunction[]
     */
    public function getFunctions()
    {
        return [
            new TwigFunction('config', [$this->config, 'get']),
        ];
    }
}