File tree Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Expand file tree Collapse file tree 3 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 1313 },
1414 "require" : {
1515 "vlucas/phpdotenv" : " ^5.0" ,
16- "thecodeholic/php-mvc-core" : " ^v1.0.4 "
16+ "thecodeholic/php-mvc-core" : " ^v1.0.5 "
1717 }
1818}
Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ public function home()
3838
3939 public function login (Request $ request )
4040 {
41+ echo '<pre> ' ;
42+ var_dump ($ request ->getBody (), $ request ->getRouteParam ('id ' ));
43+ echo '</pre> ' ;
4144 $ loginForm = new LoginForm ();
4245 if ($ request ->getMethod () === 'post ' ) {
4346 $ loginForm ->loadData ($ request ->getBody ());
@@ -85,4 +88,11 @@ public function profile()
8588 {
8689 return $ this ->render ('profile ' );
8790 }
88- }
91+
92+ public function profileWithId (Request $ request )
93+ {
94+ echo '<pre> ' ;
95+ var_dump ($ request ->getBody ());
96+ echo '</pre> ' ;
97+ }
98+ }
Original file line number Diff line number Diff line change 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+ $ app ->router ->get ('/profile/{id:\d+}/{username} ' , [SiteController::class, 'login ' ]);
42+ // /profile/{id}
43+ // /profile/13
44+ // \/profile\/\w+
4045
41- $ app ->run ();
46+ // /profile/{id}/zura
47+ // /profile/12/zura
48+
49+ // /{id}
50+ $ app ->run ();
You can’t perform that action at this time.
0 commit comments