diff --git a/app/controllers/AuthController.php b/app/controllers/AuthController.php index f314a37..eb493d2 100644 --- a/app/controllers/AuthController.php +++ b/app/controllers/AuthController.php @@ -25,7 +25,7 @@ public function __construct() */ public function login(Request $request): Response { - return $this->viewWithoutLayout('auth/login'); + return $this->view('auth/login'); } /** @@ -33,7 +33,7 @@ public function login(Request $request): Response */ public function signup(Request $request): Response { - return $this->viewWithoutLayout('auth/signup'); + return $this->view('auth/signup'); } /** diff --git a/app/controllers/BaseController.php b/app/controllers/BaseController.php index a9e557a..2457119 100644 --- a/app/controllers/BaseController.php +++ b/app/controllers/BaseController.php @@ -46,22 +46,4 @@ protected function redirect(string $url): Response $response->setHeader('Location', $url); return $response; } - - protected function viewWithoutLayout(string $view, array $data = []): Response - { - extract($data); - - ob_start(); - - $viewFile = APP_PATH . '/views/' . str_replace('.', '/', $view) . '.php'; - - if (!file_exists($viewFile)) { - throw new \Exception("View file not found: {$viewFile}"); - } - - include $viewFile; - $content = ob_get_clean(); - - return new Response($content); - } } \ No newline at end of file diff --git a/app/views/auth/login.php b/app/views/auth/login.php index 3307119..e045916 100644 --- a/app/views/auth/login.php +++ b/app/views/auth/login.php @@ -1,13 +1,9 @@ - - -
- - -