本文整理汇总了PHP中URI::url方法的典型用法代码示例。如果您正苦于以下问题:PHP URI::url方法的具体用法?PHP URI::url怎么用?PHP URI::url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类URI
的用法示例。
在下文中一共展示了URI::url方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cache_file
static function cache_file($f)
{
$css_file = Misc::key('css', $f) . '.css';
$cache_file = Cache::cache_filename($css_file);
$cache_path = ROOT_PATH . PUBLIC_BASE . $cache_file;
$version = (int) Config::get('page.css_version');
if (Config::get('debug.css_check_cache')) {
if (file_exists($cache_path)) {
$files = array_unique(explode(' ', $f));
$mtime = 0;
foreach ($files as $file) {
$file = trim($file);
list($category, $file) = explode(':', $file, 2);
if (!$file) {
$file = $category;
$category = NULL;
}
if (!$file) {
continue;
}
$path = Core::file_exists(PRIVATE_BASE . 'css/' . $file . '.css', $category);
if ($path) {
$mtime = max($mtime, filemtime($path));
}
}
if ($mtime <= filemtime($cache_path)) {
return $cache_file . '?v=' . $version;
}
}
} elseif (file_exists($cache_path)) {
return $cache_file . '?v=' . $version;
}
return URI::url('css', array('f' => $f, 'v' => $version));
}
示例2: anchor
static function anchor($url, $text = NULL, $extra = NULL, $options = array())
{
if ($extra) {
$extra = ' ' . $extra;
}
if ($text === NULL) {
$text = $url;
}
$url = URI::url($url, $options['query'], $options['fragment']);
return '<a href="' . $url . '"' . $extra . '>' . $text . '</a>';
}
示例3: setup
static function setup()
{
if (function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc() || ini_get('magic_quotes_sybase') && strtolower(ini_get('magic_quotes_sybase')) != "off") {
Input::stripslashes_deep($_GET);
Input::stripslashes_deep($_POST);
Input::stripslashes_deep($_COOKIE);
}
$route = $_SERVER['PATH_INFO'];
if (!$route) {
$route = $_SERVER['ORIG_PATH_INFO'];
}
$route = preg_replace('/^[\\/ ]*|[\\/ ]*$|' . preg_quote(Config::get('system.url_suffix')) . '$/iu', '', $route);
Input::$route = $route;
$args = array();
if (preg_match_all('/(.*?[^\\\\])\\//', $route . '/', $parts)) {
foreach ($parts[1] as $part) {
$args[] = strtr($part, array('\\/' => '/'));
}
}
Input::$args = $args;
Input::$get = $_GET;
Input::$form = array_merge($_POST, $_GET);
Input::$files = $_FILES;
$query = $_GET;
Input::$url = URI::url(Input::$route, $query);
if ($_POST['_ajax']) {
/*
$data=json_decode($_POST['_data'], TRUE);
if($data){
$new_data=array();
foreach($data as $k=>$v){
if(preg_match('/^(\S+?)(\[.+\])$/', $k, $p1)){
$key=$p1[1];
preg_match_all('/\[(\S+?)\]/', $p1[2], $p2);
while(NULL !== ($p=array_pop($p2[1]))){
$v=array($p=>$v);
}
if(is_array($new_data[$key]) && is_array($v)){
Misc::array_merge_deep($new_data[$key], $v);
} else {
$new_data[$key]=$v;
}
}else{
$new_data[$k] = $v;
}
}
Input::$form=array_merge(Input::$form, $new_data);
}
*/
Input::$AJAX['widget'] = $_POST['_widget'];
Input::$AJAX['object'] = $_POST['_object'];
Input::$AJAX['event'] = $_POST['_event'];
Input::$AJAX['mouse'] = $_POST['_mouse'];
Input::$AJAX['view'] = $_POST['_view'];
unset(Input::$form['_ajax']);
unset(Input::$form['_data']);
unset(Input::$form['_widget']);
unset(Input::$form['_object']);
unset(Input::$form['_event']);
unset(Input::$form['_mouse']);
unset(Input::$form['_view']);
}
}