1 | <?php |
||
13 | class Render |
||
14 | { |
||
15 | /** |
||
16 | * @var \Twig_Environment |
||
17 | */ |
||
18 | private $twig; |
||
19 | |||
20 | /** |
||
21 | * Construct. |
||
22 | * |
||
23 | * @param \Twig_Environment $twig |
||
24 | */ |
||
25 | 4 | public function __construct(\Twig_Environment $twig) |
|
29 | |||
30 | /** |
||
31 | * @param Root $root |
||
32 | * @param string $target |
||
33 | * @param string $templatePath |
||
34 | */ |
||
35 | public function render(Root $root, $target, $templatePath = false) |
||
52 | |||
53 | /** |
||
54 | * @param string|false $templatePath |
||
55 | * |
||
56 | * @throws \InvalidArgumentException |
||
57 | * |
||
58 | * @return string |
||
59 | */ |
||
60 | private function setTemplatePath($templatePath = false) |
||
83 | |||
84 | /** |
||
85 | * @param string $templatePath |
||
86 | * @return string |
||
87 | */ |
||
88 | private function getConfigPath($templatePath) |
||
92 | |||
93 | /** |
||
94 | * @param string $templatePath |
||
95 | * @return boolean |
||
96 | */ |
||
97 | private function hasConfig($templatePath, $key = null) |
||
115 | |||
116 | /** |
||
117 | * @param string $templatePath |
||
118 | * @return array |
||
119 | */ |
||
120 | private function loadConfig($templatePath) |
||
124 | |||
125 | /** |
||
126 | * @param string $templatePath |
||
127 | * @param string $target |
||
128 | */ |
||
129 | private function copyAssets($templatePath, $target) |
||
140 | |||
141 | /** |
||
142 | * @param string $path |
||
143 | */ |
||
144 | private function createDirIfNotExist($path) |
||
150 | |||
151 | /** |
||
152 | * @param File $file |
||
153 | * @param string $target |
||
154 | * @param string $basePath |
||
155 | */ |
||
156 | private function renderFile(File $file, $target, $basePath) |
||
173 | |||
174 | /** |
||
175 | * @param string $base |
||
176 | * @param string $actual |
||
177 | * |
||
178 | * @return string |
||
179 | */ |
||
180 | private function assetsPath($base, $actual) |
||
184 | |||
185 | /** |
||
186 | * @param Directory $directory |
||
187 | * @param string $target |
||
188 | * @param string $basePath |
||
189 | */ |
||
190 | private function renderDirectory(Directory $directory, Root $root, $target) |
||
208 | } |
||
209 |