diff --git a/app/controllers/AuthController.php b/app/controllers/AuthController.php index eb493d2..f314a37 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->view('auth/login'); + return $this->viewWithoutLayout('auth/login'); } /** @@ -33,7 +33,7 @@ public function login(Request $request): Response */ public function signup(Request $request): Response { - return $this->view('auth/signup'); + return $this->viewWithoutLayout('auth/signup'); } /** diff --git a/app/controllers/BaseController.php b/app/controllers/BaseController.php index 2457119..a9e557a 100644 --- a/app/controllers/BaseController.php +++ b/app/controllers/BaseController.php @@ -46,4 +46,22 @@ 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 e045916..3307119 100644 --- a/app/views/auth/login.php +++ b/app/views/auth/login.php @@ -1,9 +1,13 @@ - - + + + + + + Login - GoPlay Sports Platform + + + +
@@ -100,3 +104,5 @@ class="form-input"
+ + diff --git a/app/views/auth/signup.php b/app/views/auth/signup.php index 2391a50..35d0a0d 100644 --- a/app/views/auth/signup.php +++ b/app/views/auth/signup.php @@ -1,9 +1,13 @@ - - + + + + + + Sign Up - GoPlay Sports Platform + + + +
@@ -150,14 +154,7 @@ class="form-input"
-
- -
+
- +
@@ -326,4 +309,6 @@ function showToast(message, type = 'info') { setTimeout(() => toast.remove(), 300); }, 4000); } - \ No newline at end of file + + + \ No newline at end of file diff --git a/app/views/booking/book-coach.php b/app/views/booking/book-coach.php index 70bbdd3..6c2fb59 100644 --- a/app/views/booking/book-coach.php +++ b/app/views/booking/book-coach.php @@ -9,11 +9,11 @@