本文整理汇总了PHP中uri::get_path方法的典型用法代码示例。如果您正苦于以下问题:PHP uri::get_path方法的具体用法?PHP uri::get_path怎么用?PHP uri::get_path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类uri
的用法示例。
在下文中一共展示了uri::get_path方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uri
function & _fetch(&$counter, $params)
{
$result =& parent :: _fetch($counter, $params);
$uri = new uri($_SERVER['PHP_SELF']);
//we're trimming trailing slashes: thus /root/about == /root/about/
$uri->set_path(rtrim($uri->get_path(), '/'));
foreach($result as $key => $data)
{
$nav_uri = new uri($data['url']);
$nav_uri->set_path(rtrim($nav_uri->get_path(), '/'));
if ($uri->get_host() != $nav_uri->get_host())
continue;
if(is_integer($res = $uri->compare_path($nav_uri)))
{
if($res >= 0)
$result[$key]['in_path'] = true;
if($res == 0)
$result[$key]['selected'] = true;
}
}
return $result;
}
示例2: uri
function _compare_with_url($url)
{
$uri = new uri($_SERVER['PHP_SELF']);
//we're trimming trailing slashes: thus /root/about == /root/about/
$uri->set_path(rtrim($uri->get_path(), '/'));
$nav_uri = new uri($url);
$nav_uri->set_path(rtrim($nav_uri->get_path(), '/'));
if ($uri->get_host() != $nav_uri->get_host()) {
return false;
}
return $uri->compare_path($nav_uri);
}
示例3: instance
function & map_url_to_node($url, $recursive = false)
{
$tree =& tree :: instance();
$uri = new uri($url);
if(($node_id = $uri->get_query_item('node_id')) === false)
$node =& $tree->get_node_by_path($uri->get_path(), '/', $recursive);
else
$node =& $tree->get_node((int)$node_id);
return $node;
}