1 | <?php |
||
14 | class TwigHelper extends Helper |
||
15 | { |
||
16 | /** |
||
17 | * @var \N98\Util\Template\Twig |
||
18 | */ |
||
19 | protected $twig; |
||
20 | |||
21 | /** |
||
22 | * @param Config $config |
||
23 | * @throws RuntimeException |
||
24 | */ |
||
25 | public function __construct(Config $config) |
||
35 | |||
36 | /** |
||
37 | * Renders a twig template file |
||
38 | * |
||
39 | * @param string $template |
||
40 | * @param array $variables |
||
41 | * @return mixed |
||
42 | */ |
||
43 | public function render($template, $variables = array()) |
||
47 | |||
48 | /** |
||
49 | * Renders a twig string |
||
50 | * |
||
51 | * @param $string |
||
52 | * @param array $variables |
||
53 | * |
||
54 | * @return string |
||
55 | */ |
||
56 | public function renderString($string, $variables = array()) |
||
60 | |||
61 | /** |
||
62 | * @inheritdoc |
||
63 | */ |
||
64 | public function getName() |
||
68 | |||
69 | /** |
||
70 | * @param Config $config |
||
71 | * @return array |
||
72 | */ |
||
73 | private function getBaseDirsFromConfig(Config $config) |
||
96 | } |
||
97 |