forked from microweber/microweber
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
54 lines (35 loc) · 1.13 KB
/
Copy pathindex.php
File metadata and controls
54 lines (35 loc) · 1.13 KB
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
<?php
if (version_compare(phpversion(), "5.3.0", "<=")) {
exit("Error: You must have PHP version 5.3 or greater to run Microweber");
}
// error_reporting(E_ALL);
date_default_timezone_set('UTC');
require_once ('src/Microweber/bootstrap.php');
$application = new \Microweber\Application();
/*
You can extend every function of MW try this
$application = new \Microweber\MyApp();
After creating new "Application" you can use the methods of your application trough
the mw() function, which returns the latest application instance
$temp = mw()->content->get("is_active=y");
var_dump($temp);
$temp = mw()->media->get();
var_dump($temp);
$temp = $application->users->get();
var_dump($temp);
*/
// Starting Router
$router = new \Microweber\Router();
// Starting Controller
$controller = new \Microweber\Controller($application);
$router->get('/', $controller);
// Automatically map the Router to all controller functions
$router->map($controller);
/*
$rou
ter->my_controller_url = '\Microweber\TestController';
Add more controllers tp the router
open at http://localhost/my_controller_url
*/
// Run the website
$router->run();