-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
47 lines (41 loc) · 1.03 KB
/
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
<?php
require_once ("libs/TinyMvc.php");
error_reporting (E_ALL|E_STRICT);
$config = Array (
'defaultController' => 'root',
'defaultAction' => 'index',
'db' => Array (
'host' => 'localhost',
'username' => 'root',
'password' => '',
'db' => 'testdb',
'prefix' => 't_'
),
'routes' => Array (
'^/signup.*' => "users/edit/"
),
'salt' => 'test'
);
function action_root_index ($arg = null, $arg2 = null) {
$c = new Controller();
return new View ("index");
}
function action_test_index () {
return new View ("test");
}
function action_test_json() {
return [
"page" => 1,
"limit" => 10,
"total" => 4,
'test' => [
['part1' => 'hello2', 'part2' => 'world'],
['part1' => 'hello', 'part2' => 'world2'],
['part1' => 'hello', 'part2' => 'world3'],
['part1' => 'hello', 'part2' => 'world4'],
['part1' => 'hello', 'part2' => 'world5'],
],
];
}
TinyMvc::run ($config);
?>