Conditions | 2 |
Paths | 3 |
Total Lines | 25 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
22 | public function render($template_pathname, $thisArg, array $variables, array $options = []) |
||
23 | { |
||
24 | $f = \Closure::bind(function($__TEMPLATE_PATHNAME__, $__VARIABLES__) { |
||
25 | |||
26 | extract($__VARIABLES__); |
||
27 | |||
28 | require $__TEMPLATE_PATHNAME__; |
||
29 | |||
30 | }, $this->ensure_is_object($thisArg)); |
||
31 | |||
32 | ob_start(); |
||
33 | |||
34 | try |
||
35 | { |
||
36 | $f($template_pathname, [ self::VAR_TEMPLATE_PATHNAME => $template_pathname ] + $variables); |
||
37 | |||
38 | return ob_get_clean(); |
||
39 | } |
||
40 | catch (\Exception $e) |
||
41 | { |
||
42 | ob_end_clean(); |
||
43 | |||
44 | throw $e; |
||
45 | } |
||
46 | } |
||
47 | |||
74 |