/** * 构造url * @param $class 类名 * @param $method 方法名 * @param $param 参数(a=1&b=2&c=3...) * @param $static 是否是静态地址 */ function url($class = null, $method = null, $param = null, $static = true) { $url = sharePHP::get_base_url(); if ($class && $method) { if (sharePHP::get_mode() == 1) { $url .= '?action=' . $class . '.' . $method; } else { if (sharePHP::get_mode() == 2) { $url .= $class . '/' . $method . '/'; } else { if ($static === true) { $url .= 'html/' . $class . '/' . $method . '/'; } else { if (MODE == 1) { $url .= '?action=' . $class . '.' . $method; } else { $url .= $class . '/' . $method . '/'; } } } } } if (!$param) { return $url; } $action = explode('&', $param); foreach ($action as $act) { if (sharePHP::get_mode() == 1) { $url .= '&' . $act; } else { if (sharePHP::get_mode() == 2) { $p = explode('=', $act); $url .= $p[0] . '/' . $p[1] . '/'; } else { $p = explode('=', $act); if ($static === true) { $url .= $p[1] . '.html'; } else { if (MODE == 1) { $url .= '&' . $act; } else { $url .= $p[0] . '/' . $p[1] . '/'; } } } } } return $url; }
/** * 导入网站图标 */ public static function load_short_icon() { echo '<link rel="shortcut icon" href="' . sharePHP::get_base_url() . 'skin/' . self::$skin . '/images/favicon.ico?' . filesystem::mtime(sharePHP::get_application_dir() . '/skin/' . self::$skin . '/images/favicon.ico') . '"/>'; }