Exemplo n.º 1
0
                } else {
                    $data = $arr[2];
                }
            }
        } else {
            $control = $arr[1];
            $action = $arr[2];
            $data = $arr[3];
        }
    }
}
/*end tach_url*/
$url = $_SERVER['REQUEST_URI'];
$url = str_replace(CONS_BASE_DIR, '', $url);
/*upload host tắt str_replace này*/
tach_url($url, $control, $action, $data);
if ($control != CONS_DEFAULT_ADMIN_CONTROLLER) {
    $c = new control_web($control, $action, $data);
    $c->index();
} else {
    $c = new control_admin($control, $action, $data);
    $c->index();
}
function __autoload($class_name)
{
    if (preg_match('/control_/', $class_name)) {
        $dir_app = 'controller/';
    } else {
        $dir_app = 'model/';
    }
    $filename = $dir_app . $class_name . '.php';
Exemplo n.º 2
0
                $data = 1;
            } else {
                $data = $arr[3];
            }
        }
    } else {
        $control = $arr[1];
        $action = $arr[2];
        $data = $arr[3];
    }
}
/*end tach_url*/
$url = $_SERVER['REQUEST_URI'];
$url = str_replace(CONS_BASE_DIR, '', $url);
/*upload host tắt str_replace này*/
tach_url($url, $control, $action, $data, $lang);
if ($control != CONS_DEFAULT_ADMIN_CONTROLLER) {
    $c = new control_web($control, $action, $data, $lang);
    $c->index();
} else {
    $c = new control_admin($control, $action, $data);
    $c->index();
}
function __autoload($class_name)
{
    if (preg_match('/control_/', $class_name)) {
        $dir_app = 'controller/';
    } else {
        $dir_app = 'model/';
    }
    $filename = $dir_app . $class_name . '.php';
Exemplo n.º 3
0
<?php

session_start();
$lang = 'vi';
require_once "config.php";
$url = $_SERVER['REQUEST_URI'];
$kq = tach_url($url, $lang, $cname, $action, $params);
if (class_exists($cname, true) == true) {
    $c = new $cname($action, $params, $lang);
} else {
    die('Khong co controller ' . $cname);
}
//require_once "cachebegin.php"; //case
require "lang_{$lang}.php";
ob_start();
if (method_exists($c, $action)) {
    $c->{$action}();
} else {
    die('Không có action ' . $action);
}
$str = ob_get_clean();
$str = str_replace("{SiteTitle}", SiteTitle, $str);
$str = str_replace("{BaiXN}", BaiXN, $str);
$str = str_replace("{DangNhap}", DangNhap, $str);
$str = str_replace("{UserName}", UserName, $str);
$str = str_replace("{Password}", Password, $str);
$str = str_replace("{Remember}", Remember, $str);
$str = str_replace("{Register}", Register, $str);
$str = str_replace("{ForgotPassword}", ForgotPassword, $str);
$str = str_replace("{ChangePassword}", ChangePassword, $str);
$str = str_replace("{Logout}", Logout, $str);