<?php global $timers, $userData, $availableForUnregistered, $extraHeadScripts; extract($tpl, EXTR_PREFIX_ALL, '_tpl'); $isProductionEnv = $wo->isProductionEnv; wooofTimerStop('controller'); ?> <html lang="en"> <head> <meta charset="utf-8"> <title><?php echo $_tpl_browserTitle; ?> </title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <!-- Le styles --> <!-- link href='https://fonts.googleapis.com/css?family=Roboto+Condensed' rel='stylesheet' type='text/css'--> <!-- include font awesome --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <link href="<?php echo $wo->assetsURL; ?> css/fonts.css" rel="stylesheet">
public function run() { wooofTimerStart('AltoRouter'); $match = $this->match(); wooofTimerStop('AltoRouter'); //var_dump($match); die(); if ($match === FALSE) { header($_SERVER["SERVER_PROTOCOL"] . ' 404 Not Found'); die('No route found!'); } // call closure or throw 404 status if ($match && is_callable($match['target'])) { wooofTimerStart('controller', $match['name']); call_user_func_array($match['target'], $match['params']); } else { // no route was matched header($_SERVER["SERVER_PROTOCOL"] . ' 404 Not Found'); die('Nothing to execute!'); } }
<?php // index.php $executionTimers['wooof_1'][0] = microtime(true); require_once '../setup.inc.php'; $wo = new WOOOF(true, null, null, false); if (!$wo->constructedOk) { $wo->handleShowStopperError("1000 Failed to init WOOOF."); } wooofTimerStop('wooof_1'); $router = new AltoRouter(); $router->setBasePath(substr($wo->getConfigurationFor('siteBaseURL') . $wo->getConfigurationFor('publicSite'), 0, -1)); /*******************************************************************/ // the start/home // $router->map('GET', '/', function () use($wo) { VO_CtrlSite::home($wo); }, 'home'); require_once 'routes/movies.php'; require_once 'routes/profile.php'; require_once 'routes/registration.php'; require_once 'routes/evaluations.php'; /* ========================================================================== */ // Find and follow route based on URL // Handling of no matches, etc. inside the 'run' function. $router->run($wo); /* End of file index.php */