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 13
13
},
14
14
"require" : {
15
15
"vlucas/phpdotenv" : " ^5.0" ,
16
- "thecodeholic/php-mvc-core" : " ^v1.0.4 "
16
+ "thecodeholic/php-mvc-core" : " ^v1.0.5 "
17
17
}
18
18
}
Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ public function home()
38
38
39
39
public function login (Request $ request )
40
40
{
41
+ echo '<pre> ' ;
42
+ var_dump ($ request ->getBody (), $ request ->getRouteParam ('id ' ));
43
+ echo '</pre> ' ;
41
44
$ loginForm = new LoginForm ();
42
45
if ($ request ->getMethod () === 'post ' ) {
43
46
$ loginForm ->loadData ($ request ->getBody ());
@@ -85,4 +88,11 @@ public function profile()
85
88
{
86
89
return $ this ->render ('profile ' );
87
90
}
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 32
32
$ app ->router ->get ('/register ' , [SiteController::class, 'register ' ]);
33
33
$ app ->router ->post ('/register ' , [SiteController::class, 'register ' ]);
34
34
$ app ->router ->get ('/login ' , [SiteController::class, 'login ' ]);
35
+ $ app ->router ->get ('/login/{id} ' , [SiteController::class, 'login ' ]);
35
36
$ app ->router ->post ('/login ' , [SiteController::class, 'login ' ]);
36
37
$ app ->router ->get ('/logout ' , [SiteController::class, 'logout ' ]);
37
38
$ app ->router ->get ('/contact ' , [SiteController::class, 'contact ' ]);
38
39
$ app ->router ->get ('/about ' , [AboutController::class, 'index ' ]);
39
40
$ 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+
40
45
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