Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
35 | public function render($template, array $values = [], $basePath = null) |
||
36 | { |
||
37 | $twig = $this->twig; |
||
38 | if (isset($basePath)) { |
||
39 | $twig = clone $this->twig; |
||
40 | $twig->setLoader(new Twig_Loader_Filesystem($basePath)); |
||
41 | } |
||
42 | try { |
||
43 | return $twig->render($template, $values + $this->values); |
||
44 | } catch (\Exception $e) { |
||
45 | throw new FileNotFoundException("Cannot find the template file, {$template}"); |
||
46 | } |
||
47 | } |
||
48 | } |
||
49 |