本文整理匯總了PHP中Path::absolute方法的典型用法代碼示例。如果您正苦於以下問題:PHP Path::absolute方法的具體用法?PHP Path::absolute怎麽用?PHP Path::absolute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Path
的用法示例。
在下文中一共展示了Path::absolute方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: htmlformat_menuitem
function htmlformat_menuitem($root, $s, $u, $c)
{
$v['%sign%'] = $s;
$v['%url%'] = $u;
$v['%caption%'] = $c;
$a = Path::absolute($u);
$b = Path::absolute($root . substr($_SERVER['REQUEST_URI'], 1));
if ($a == $b) {
$item = FileReader::readFile($root . 'menulinkv.html', $v);
} else {
$item = FileReader::readFile($root . 'menulink.html', $v);
}
return $item;
}
示例2: format_menuitem
function format_menuitem($url, $caption, $level, $dir = false)
{
$url = Path::linkto($GLOBALS['root'] . $url);
$caption = output::mask($caption);
$m = array('menu_spacer' => array(), 'menu_entry' => array(), 'menu_dir' => array(), 'menu_url' => $url, 'menu_caption' => array(), 'menu_caption_this' => array());
for ($i = 0; $i < $level; $i++) {
$m['menu_spacer'][] = array();
}
if ($dir) {
$m['menu_dir'][] = array();
} else {
$m['menu_entry'][] = array();
}
$document_root = $_SERVER['DOCUMENT_ROOT'];
if (substr($document_root, -1) == '/') {
$document_root = substr($document_root, 0, -1);
}
$a = Path::absolute($url);
$b = sessionurl($a);
$c = $document_root . $_SERVER['REQUEST_URI'];
if ($a == $c || $b == $c) {
$m['menu_caption_this'][0]['menu_caption'] = $caption;
} else {
$m['menu_caption'][0]['menu_caption'] = $caption;
}
return $m;
}