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