Example #1
0
 * By default development will show errors but production will hide them.
 */
if (defined('ENVIRONMENT')) {
    switch (ENVIRONMENT) {
        case 'development':
            error_reporting(E_ALL);
            break;
        case 'production':
            error_reporting(0);
            break;
        default:
            exit('The application environment is not set correctly.');
    }
}
//initiate config
new \core\config();
//create alias for Router
use core\router as Router, helpers\url as Url;
//define routes
Router::any('', '\\controllers\\glvc@index');
Router::any('/visa', '\\controllers\\glvc@travel_visa');
Router::any('/passport_photo', '\\controllers\\glvc@passport_photo');
Router::any('/about', '\\controllers\\glvc@about');
Router::any('/contact', '\\controllers\\glvc@contact');
//if no route found
Router::error('\\core\\error@index');
//turn on old style routing
Router::$fallback = false;
//execute matched routes
Router::dispatch();