Initial commit, framework/frontend assets setup

This commit is contained in:
Maarten 2024-11-25 18:59:11 +01:00
commit 9d9858bb37
32 changed files with 4651 additions and 0 deletions

View file

@ -0,0 +1,28 @@
<?php
namespace Core\View\Render;
use Core\View\Render;
class HtmlRender extends Render
{
/**
* @inheritDoc
* @throws \Exception
*/
public function render(): void
{
$basePath = $_SERVER['DOCUMENT_ROOT'];
$viewsPath = $basePath . '/../resources/views/' . str_replace('.', '/', $this->view) . '.php';
if (file_exists($viewsPath)) {
extract($this->data);
include $viewsPath;
return;
}
throw new \Exception('View not found');
}
}