<?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
<?php ob_start(); session_start(); error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT); ini_set('display_errors', true); ini_set('default_socket_timeout', 120); include_once 'application/Bootstrap.class.php'; Bootstrap::singleton()->handle();
?> ">Home</a></li> <li><a href="<?php echo $this->url('Rotation'); ?> ">Rotation</a></li> </ul> </div> </div> </div> <div class="container-fluid"> <div class="row"> <div class="col-md-12 col-sm-12 main"> <?php echo Bootstrap::singleton()->renderMainContent(); ?> </div> </div> </div> <!-- Include all compiled plugins (below), or include individual files as needed --> <script src="<?php echo $this->mediaDir; ?> /templates/default/javascript/jquery-2.1.4.min.js"></script> <script src="<?php echo $this->mediaDir; ?> /templates/default/javascript/timer.jquery.js"></script> <script src="<?php echo $this->mediaDir;
public function secondsToHms($seconds) { return Bootstrap::singleton()->secondsToHms($seconds); }
public function getActiveUser() { return Bootstrap::singleton()->getActiveUser(); }
/** * Constructor * Instantiate bootstrap, get instance of conversion tools */ public function __construct() { require_once 'application/Bootstrap.php'; $this->bs = Bootstrap::singleton(); $this->dfcTools = $this->bs->getTools(); }