Skip to content

Commit f2b52d0

Browse files
Williams IsaacWilliams Isaac
Williams Isaac
authored and
Williams Isaac
committed
Updated Readme
1 parent 2140dd0 commit f2b52d0

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

Controllers/indexController.php

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ public function index()
1919
Init::view('index');
2020
}
2121

22+
public function payMe()
23+
{
24+
return "Pay ME";
25+
}
26+
2227

2328
}
2429
?>

README.md

+35-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Routing is a very essential part of a Web Application. CogentPHP has an simple y
2929
<?php
3030

3131
/** Autoloading The required Classes **/
32-
32+
3333
use Core\Core\C_Base;
3434
use Core\Core\Redirect;
3535

@@ -47,6 +47,40 @@ Routing is a very essential part of a Web Application. CogentPHP has an simple y
4747
Init::view('index');
4848
}
4949

50+
public function pay()
51+
{
52+
/** Initializing a index.html view Found in (Views/index.html) **/
53+
Init::view('index');
54+
}
55+
56+
public function withdraw()
57+
{
58+
/** Initializing a index.html view Found in (Views/index.html) **/
59+
Init::view('index');
60+
}
5061

5162
}
5263
?>
64+
65+
To generate URL from the Above controller, We have
66+
67+
localhost/account/
68+
The URL Maps to accountController -> index()
69+
Since no Method is Specified in URL, It maps it to index method by default.
70+
71+
localhost/account/pay
72+
This URL Maps to accountController -> pay()
73+
localhost/account/withdraw
74+
This URL Maps to accountController -> withdraw()
75+
localhost/account/begin
76+
This results in a 404 error, Because the method begin() doesn't exist in the Class
77+
78+
79+
The URL is Case Insensitive as:
80+
81+
accountController -> withdrawMoney() ==
82+
83+
1. localhost/account/withdrawmoney
84+
2. localhost/account/withdrawMoney
85+
86+
They Both Evaluate to the same Method

0 commit comments

Comments
 (0)