| 1 | <?php |
||
| 11 | class HtmlRender |
||
| 12 | { |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var array View variables |
||
| 16 | */ |
||
| 17 | protected $variables; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param array $variables |
||
| 21 | */ |
||
| 22 | 1 | public function __construct(array $variables) |
|
| 26 | |||
| 27 | /** |
||
| 28 | * Render files |
||
| 29 | * |
||
| 30 | * First file in array is rendered first and key is set in variables array for use by following files |
||
| 31 | * |
||
| 32 | * @param array $files Files to render |
||
| 33 | * |
||
| 34 | * @return string Output |
||
| 35 | */ |
||
| 36 | 1 | public function render(array $files): string |
|
| 48 | |||
| 49 | /** |
||
| 50 | * Render file |
||
| 51 | * |
||
| 52 | * @param string $file File to render |
||
| 53 | * |
||
| 54 | * @return string Output |
||
| 55 | */ |
||
| 56 | 2 | protected function renderFile(string $file): string |
|
| 85 | } |
||
| 86 |