Example #1
0
/**
 * URL函数
 */
function url($route, $params = null)
{
    if (!isset($params['siteid']) && isset($_GET['siteid']) && substr_count($route, '/') >= 2) {
        //站点判断(前端控制器不带该参数)
        $params['siteid'] = (int) $_GET['siteid'];
        $params = array_reverse($params);
    }
    return Controller::create_url($route, $params);
}
Example #2
0
 /**
  * 网址(URL)组装操作,组装绝对路径的URL
  */
 public function create_url($route, $params = null)
 {
     return Controller::create_url($route, $params);
 }
Example #3
0
/**
 * URL函数
 */
function url($route, $params = null)
{
    if (file_exists(APP_ROOT . 'cache\\member.lock')) {
        $domain = explode(';', file_get_contents(APP_ROOT . 'cache\\member.lock'));
        if ($domain[1] && $route == 'api/user') {
            $domain = 'http://' . str_replace('http://', '', $domain[1]) . '/member/index.php?c=api&m=userinfo';
            return $domain;
        }
    }
    if (!isset($params['siteid']) && isset($_GET['siteid']) && substr_count($route, '/') >= 2) {
        //站点判断(前端控制器不带该参数)
        $params['siteid'] = (int) $_GET['siteid'];
        $params = array_reverse($params);
    }
    return Controller::create_url($route, $params);
}