mirror of
https://github.com/mivodev/mivo.git
synced 2026-01-26 05:25:42 +07:00
21 lines
432 B
PHP
21 lines
432 B
PHP
<?php
|
|
|
|
namespace App\Core;
|
|
|
|
class Controller {
|
|
public function view($view, $data = []) {
|
|
extract($data);
|
|
$viewPath = ROOT . '/app/Views/' . $view . '.php';
|
|
|
|
if (file_exists($viewPath)) {
|
|
require_once $viewPath;
|
|
} else {
|
|
echo "View not found: $view";
|
|
}
|
|
}
|
|
public function redirect($url) {
|
|
header("Location: " . $url);
|
|
exit();
|
|
}
|
|
}
|