This repository has been archived on 2023-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
web/app/class/Template.php

24 lines
602 B
PHP
Raw Normal View History

2022-01-14 06:43:31 +00:00
<?php
class Template {
// Generates a dynamic URL to the given path.
private function urlFor($path): string
{
// TODO: Make this WORK!!
$url = dirname(dirname(str_replace(realpath($_SERVER['DOCUMENT_ROOT']), '', realpath(__DIR__))));
if ((strlen($url) > 1)) {
$url = htmlspecialchars($url . '/');
}
//FUUUUUCKKK
echo($_SERVER['DOCUMENT_ROOT'] . ' ' . __DIR__);
die();
return($url.$path);
}
public function render($name): void
{
require(__DIR__ . '/../template/' . $name . '.php');
}
}