20 lines
		
	
	
		
			485 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			485 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?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']]);
 | |
|     }
 | |
| 
 | |
|     public function redirect(string $url): void
 | |
|     {
 | |
|         header("Location: " . $url);
 | |
|     }
 | |
| } |