2024-07-12 11:31:04 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace kernel;
|
|
|
|
|
|
|
|
class Controller
|
|
|
|
{
|
|
|
|
protected \Twig\Loader\FilesystemLoader $loader;
|
|
|
|
protected \Twig\Environment $twig;
|
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
$this->loader = new \Twig\Loader\FilesystemLoader(ROOT_DIR . $_ENV['VIEWS_PATH']);
|
|
|
|
$this->twig = new \Twig\Environment($this->loader, ['cache' => ROOT_DIR . $_ENV['VIEWS_CACHE_PATH']]);
|
|
|
|
}
|
2024-07-24 14:07:45 +03:00
|
|
|
|
|
|
|
public function redirect(string $url): void
|
|
|
|
{
|
|
|
|
header("Location: " . $url);
|
|
|
|
}
|
2024-07-12 11:31:04 +03:00
|
|
|
}
|