<?php // No cache header('Cache-Control: no-cache, must-revalidate'); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); define('APP_DIR', realpath('./') . '/'); define('CF_DIR', realpath('../confeature/') . '/'); define('DATA_DIR', realpath('../data/') . '/'); try { // Loading Confeature require_once CF_DIR . 'init.php'; // Loading the controllers and actions from url info Routes::dispatch(); } catch (Exception $e) { if (Config::DEBUG) { echo $e->getMessage(); } }
<?php require_once dirname(__FILE__) . '/config/routes.php'; $route_options = array(array('path' => '/', 'controller' => 'index', 'action' => 'index'), array('path' => '/hello', 'controller' => 'index', 'action' => 'hello')); $r = new Routes($route_options); $r->dispatch($_SERVER['REQUEST_URI']);
<?php // Prepare the global variables define('BASE_PATH', realpath(dirname(__FILE__))); // Get the main files include_once 'system/classes/base.php'; include_once 'system/classes/routes.php'; include_once 'system/libraries/php-activerecord/ActiveRecord.php'; // Initialize the base classes $Base = new Base(); $Map = new Routes(); // Include config files // Include config files include_once 'config/config.php'; include_once 'config/routes.php'; // Connect the the database $Base->load_db(); // Load the page $Map->dispatch();