public static function getInstance() { if (null === self::$_router) { self::$_router = new Router(); } return self::$_router; }
private static function router() { //ROUTER $router = RouterSingleton::getInstance(); $router->setBasePath(Application::PROJECT); include_once 'routes.php'; $match = $router->match(); // call closure or throw 404 status if ($match && is_callable($match['target'])) { call_user_func_array($match['target'], $match['params']); } else { // no route was matched header($_SERVER["SERVER_PROTOCOL"] . ' 404 Not Found'); include_once 'src/views/404.php'; } //END ROUTER }