game/_incl_data/class/Core/View.php

19 lines
388 B
PHP

<?php
namespace Core;
class View
{
public static function render(string $view, array $arguments = [])
{
extract($arguments, EXTR_SKIP);
$file = $_SERVER['DOCUMENT_ROOT'] . "/_incl_data/Views/$view";
if (is_readable($file)) {
require $file;
} else {
trigger_error("File $file not found!", E_USER_ERROR);
}
}
}