Example #1
0
if ($url == "") {
    $url = "index";
} elseif ($url == "test" || $url == "admin") {
    if ($url == "admin") {
        $url = "admin";
    } else {
        $url = "index";
    }
    $construction = false;
}
if (strpos($url, "/")) {
    $url = str_replace("/", "", $url);
}
//checking if the requested page has a class that exists
if (class_exists($url)) {
    if ($construction) {
        $obj = new index('index');
        $obj->construction();
    } else {
        $obj = new $url($url);
        if (isset($action)) {
            //$obj->$action($url_vars);
        } else {
            $obj->index();
        }
    }
} else {
    $url = 'error';
    $obj = new $url($url);
    $obj->index();
}