Add MySQL schema dump for phpMyAdmin
This commit is contained in:
19
app/Core/View.php
Normal file
19
app/Core/View.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Core;
|
||||
|
||||
class View
|
||||
{
|
||||
public static function render(string $template, array $data = []): string
|
||||
{
|
||||
$path = base_path('resources/views/' . $template . '.php');
|
||||
if (!file_exists($path)) {
|
||||
throw new \RuntimeException('View not found: ' . $template);
|
||||
}
|
||||
|
||||
extract($data, EXTR_SKIP);
|
||||
ob_start();
|
||||
include $path;
|
||||
return (string) ob_get_clean();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user