1 | <?php |
||
11 | class Twig implements ViewEngineInterface |
||
12 | { |
||
13 | |||
14 | private $PUBLIC_PATH = 'public/'; |
||
15 | |||
16 | /** |
||
17 | * @var Twig_Environment |
||
18 | */ |
||
19 | private $twig; |
||
20 | |||
21 | /** |
||
22 | * Twig template file |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | private $templateFilename = ''; |
||
27 | |||
28 | /** |
||
29 | * @var array engine setting |
||
30 | */ |
||
31 | private $settings = []; |
||
32 | |||
33 | /** |
||
34 | * rendering template variables |
||
35 | * @var array |
||
36 | */ |
||
37 | private $var = []; |
||
38 | |||
39 | public function __construct($settings = []) |
||
40 | { |
||
41 | $loader = new Twig_Loader_Filesystem($settings['path']); |
||
42 | $this->twig = new Twig_Environment($loader, $settings['settings']); |
||
43 | |||
44 | $this->settings = $settings; |
||
45 | |||
46 | $this->addCssFunction(); |
||
47 | $this->addAssetFunction(); |
||
48 | $this->addUrlFunction(); |
||
49 | } |
||
50 | |||
51 | public function set($key, $value) |
||
55 | |||
56 | public function getVariables() |
||
60 | |||
61 | public function file($fileName) |
||
65 | |||
66 | public function getFile() |
||
70 | |||
71 | public function render() |
||
75 | |||
76 | private function addCssFunction() |
||
84 | |||
85 | private function addAssetFunction() |
||
92 | |||
93 | private function addUrlFunction() |
||
100 | |||
101 | public function cssFunction($url) |
||
105 | |||
106 | public function assetFunction($file) |
||
110 | |||
111 | public function urlFunction($url = '') |
||
115 | } |
||
116 |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.