diff --git a/composer.json b/composer.json index ff794d0..12a7b15 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,6 @@ }, "require": { "vlucas/phpdotenv": "^5.0", - "thecodeholic/php-mvc-core": "^v1.0.4" + "thecodeholic/php-mvc-core": "^v1.0.5" } } diff --git a/controllers/SiteController.php b/controllers/SiteController.php index bb4ee04..fdb79b4 100644 --- a/controllers/SiteController.php +++ b/controllers/SiteController.php @@ -38,6 +38,9 @@ public function home() public function login(Request $request) { + echo '
';
+        var_dump($request->getBody(), $request->getRouteParam('id'));
+        echo '
'; $loginForm = new LoginForm(); if ($request->getMethod() === 'post') { $loginForm->loadData($request->getBody()); @@ -85,4 +88,11 @@ public function profile() { return $this->render('profile'); } -} \ No newline at end of file + + public function profileWithId(Request $request) + { + echo '
';
+        var_dump($request->getBody());
+        echo '
'; + } +} diff --git a/public/index.php b/public/index.php index 33d2be1..8572ddf 100644 --- a/public/index.php +++ b/public/index.php @@ -32,10 +32,19 @@ $app->router->get('/register', [SiteController::class, 'register']); $app->router->post('/register', [SiteController::class, 'register']); $app->router->get('/login', [SiteController::class, 'login']); +$app->router->get('/login/{id}', [SiteController::class, 'login']); $app->router->post('/login', [SiteController::class, 'login']); $app->router->get('/logout', [SiteController::class, 'logout']); $app->router->get('/contact', [SiteController::class, 'contact']); $app->router->get('/about', [AboutController::class, 'index']); $app->router->get('/profile', [SiteController::class, 'profile']); +$app->router->get('/profile/{id:\d+}/{username}', [SiteController::class, 'login']); +// /profile/{id} +// /profile/13 +// \/profile\/\w+ -$app->run(); \ No newline at end of file +// /profile/{id}/zura +// /profile/12/zura + +// /{id} +$app->run();