<?php
/**
* Front controller
*
* Requiere PHP7.3
*
* Desarrolla JARS Costa Rica
* www.jarscr.com
* Telefono: 4000-2528
*
* Programador: Alfredo Rodriguez
*
**/
/**
* Composer
*/
require dirname(__DIR__) . '/vendor/autoload.php';
/**
* Error and Exception handling
*/
error_reporting(E_ALL);
set_error_handler('Core\Error::errorHandler');
set_exception_handler('Core\Error::exceptionHandler');
/**
* Routing
*/
$router = new Core\Router();
// Add the routes
$router->add('', ['controller' => 'Home', 'action' => 'index']);
$router->add('{controller}/{action}');
if (isset($_SERVER['QUERY_STRING'])) {
$router->dispatch($_SERVER['QUERY_STRING']);
}
|