-
Notifications
You must be signed in to change notification settings - Fork 68
/
index.php
38 lines (35 loc) · 1.36 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
<?php
if (isset($_GET['function'])) {
require_once 'application/controllers/EpubController.php';
require_once 'application/controllers/MobiController.php';
require_once 'application/controllers/PdfController.php';
require_once('application/Bootstrap.php');
$function = ucfirst($_GET['function']);
if (isset($_GET['str'])) $options = array("html" => "<h1>Hello, World</h1><p><strong>Here is some text, wrapped in 'p' and 'strong' HTML tags</strong></p><p><em>Here is some text, wrapped in 'p' and 'em' HTML tags</em></p>");
$controllerName = "{$function}Controller";
$modelName = "{$function}Model";
$actionName = "create{$function}Action";
//use variable variables based on $_GET variable to instantiate class and call method
$bootstrap = Bootstrap::singleton();
$tools = $bootstrap->getTools();
$transform = new TransformModel();
$model = new $modelName($tools);
$controller = new $controllerName($model, $tools, $transform);
$controller->$actionName($options);
exit();
}
?>
<html>
<head></head>
<link rel="stylesheet" href="bootstrap.css" />
<body>
<div class="container">
<?php
//a VERY simple page router/despatcher to include the 'default' view if the index.php file is requested
if (strtolower($_SERVER['PHP_SELF']) == "/digitalformatconvert/index.php") {
include 'application/views/default.php';
}
?>
</div>
</body>
</html>