Skip to content

Commit fc66f92

Browse files
committed
Working on url params
1 parent 5bd7e5d commit fc66f92

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

controllers/SiteController.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,11 @@ public function profile()
8585
{
8686
return $this->render('profile');
8787
}
88-
}
88+
89+
public function profileWithId(Request $request)
90+
{
91+
echo '<pre>';
92+
var_dump($request->getBody());
93+
echo '</pre>';
94+
}
95+
}

public/index.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,26 @@
2424

2525
$app = new Application(dirname(__DIR__), $config);
2626

27-
$app->on(Application::EVENT_BEFORE_REQUEST, function(){
27+
/*$app->on(Application::EVENT_BEFORE_REQUEST, function(){
2828
echo "Before request from second installation";
29-
});
29+
});*/
3030

3131
$app->router->get('/', [SiteController::class, 'home']);
3232
$app->router->get('/register', [SiteController::class, 'register']);
3333
$app->router->post('/register', [SiteController::class, 'register']);
3434
$app->router->get('/login', [SiteController::class, 'login']);
35+
$app->router->get('/login/{id}', [SiteController::class, 'login']);
3536
$app->router->post('/login', [SiteController::class, 'login']);
3637
$app->router->get('/logout', [SiteController::class, 'logout']);
3738
$app->router->get('/contact', [SiteController::class, 'contact']);
3839
$app->router->get('/about', [AboutController::class, 'index']);
3940
$app->router->get('/profile', [SiteController::class, 'profile']);
41+
// /profile/{id}
42+
// /profile/13
43+
// \/profile\/\w+
4044

41-
$app->run();
45+
// /profile/{id}/zura
46+
// /profile/12/zura
47+
48+
// /{id}
49+
$app->run();

0 commit comments

Comments
 (0)