pour prod
This commit is contained in:
19
app/Core/Controller.php
Normal file
19
app/Core/Controller.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Core;
|
||||
|
||||
abstract class Controller
|
||||
{
|
||||
protected function render(string $view, array $data = []): void
|
||||
{
|
||||
$viewFile = dirname(__DIR__) . '/Views/' . $view . '.php';
|
||||
if (!is_file($viewFile)) {
|
||||
throw new \RuntimeException('Vue introuvable : ' . $view);
|
||||
}
|
||||
|
||||
extract($data, EXTR_SKIP);
|
||||
require $viewFile;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user