-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.php
55 lines (30 loc) · 902 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
require_once('Router.php');
//Adding the routes
Router::add('/', 'index');
Router::add('/one', 'test_one');
Router::add('/two', 'test_two');
Router::add('/two/([a-z]+)', 'test_two');
Router::add('/three/([a-z]+)', 'TestController.three');
//Running the routing
Router::run();
function index($args) {
echo "This is the <strong>index</strong> action.<br />";
}//index()
function test_one($args) {
echo "This is the <strong>test_one</strong> action.<br />";
}//test_one()
function test_two($args) {
echo "This is the <strong>test_two</strong> action.<br />";
echo "The args where:<br /><pre>";
print_r($args);
echo "</pre>";
}//test_two()
class TestController {
function three($args) {
echo "This is the <strong>TestController::three</strong> action.<br />";
echo "The args where:<br /><pre>";
print_r($args);
echo "</pre>";
}
}