Es algo asi:
Código PHP:
Ver originalclass Route
{
/*/
* I18n
/*/
const ERROR_LOADF = "No se pudo cargar la url.";
const ERROR_CLASS = "No se pudo encontrar el recurso solicitado.";
const ERROR_CALLM = "El recurso no reconoce la accion solicitada.";
public static function load(&$class, $sys, &$method = null)
{
{
$file = "applications/$sys/$class.php";
throw new \Exception(self::ERROR_LOADF, 601);
require_once($file);
$class[$pos] = ucfirst($class[$pos]);
throw new \Exception(self::ERROR_CLASS, 602);
}
throw new \Exception(self::ERROR_CALLM, 603);
}
public static function resolve($sys, $route = "") {
try {
require_once("core/dbal.php");
if($_SERVER["REQUEST_METHOD"] == "POST")
{
self::load($class, $sys, $method);
$instance = new $class();
unset($class, $_GET, $_POST, $_FILES);
}
}
catch(\Exception $e)
{
require_once("applications/$sys/error.php");
$instance = new \Error();
$method = strtolower($_SERVER["REQUEST_METHOD"])."_500"; echo $instance->$method($route, $e, $sys);
}
}
}