本文整理汇总了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;
}