當前位置: 首頁>>代碼示例>>PHP>>正文


PHP uri::compare_path方法代碼示例

本文整理匯總了PHP中uri::compare_path方法的典型用法代碼示例。如果您正苦於以下問題:PHP uri::compare_path方法的具體用法?PHP uri::compare_path怎麽用?PHP uri::compare_path使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在uri的用法示例。


在下文中一共展示了uri::compare_path方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: uri

  function & _fetch(&$counter, $params)
  {
    $result =& parent :: _fetch($counter, $params);
    $uri = new uri($_SERVER['PHP_SELF']);   

    foreach($result as $key => $data)
    {
      $nav_uri = new uri($data['url']);

      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;
          $params['path'] = $data['path'];
          $result[$key]['items'] = $this->_fetch(&$counter, $params); 
        }  
        if($res == 0)
          $result[$key]['selected'] = true;
      }
    }
    return $result;
  }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:26,代碼來源:recursive_navigation_datasource.class.php

示例2: 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;
  }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:29,代碼來源:simple_navigation_datasource.class.php

示例3: 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);
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:12,代碼來源:simple_navigation_datasource.class.php

示例4: uri

 function &_fetch(&$counter, $params)
 {
     $result =& parent::_fetch($counter, $params);
     $uri = new uri($_SERVER['PHP_SELF']);
     foreach ($result as $key => $data) {
         if (is_integer($res = $uri->compare_path(new uri($data['url'])))) {
             if ($res >= 0) {
                 $result[$key]['in_path'] = true;
             }
             if ($res == 0) {
                 $result[$key]['selected'] = true;
             }
         }
     }
     return $result;
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:16,代碼來源:tree_navigation_datasource.class.php

示例5: uri

 function &_fetch(&$counter, $params)
 {
     $result =& parent::_fetch($counter, $params);
     $requested_uri = new uri($_SERVER['REQUEST_URI']);
     $nav_uri = new uri();
     foreach ($result as $key => $data) {
         $nav_uri->parse($data['url']);
         if ($requested_uri->compare_path($nav_uri) === 0) {
             $result[$key]['selected'] = true;
             if ($nav_uri->get_query_item('action') !== $requested_uri->get_query_item('action')) {
                 $result[$key]['selected'] = false;
             }
         }
     }
     return $result;
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:16,代碼來源:tree_navigation_datasource.class.php


注:本文中的uri::compare_path方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。