Total Complexity | 1 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
5 | final class PhpViewFileHelper |
||
6 | { |
||
7 | /** |
||
8 | * Renders a view file as a PHP script. |
||
9 | * |
||
10 | * This method expects a php file and includes the file after it extracts the given parameters (name-value pairs) |
||
11 | * to make them available to the php file. Captures the output and returns its result as a string. |
||
12 | * |
||
13 | * @param string $file full path of the view file |
||
14 | * @param array $params the parameters that will be extracted and make them available to the php view file. |
||
15 | * |
||
16 | * @return string the rendering result. |
||
17 | 2 | */ |
|
18 | public static function render($file, array $params = []) |
||
27 |