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


PHP cmsFramework::_parseSefRoute方法代碼示例

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


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

示例1: JreviewsParseRoute

function JreviewsParseRoute($segments)
{
    $vars = array();
    # Load own uri to overcome Joomla encoding issues with Greek params
    $uri = cmsFramework::_getUri();
    // Fix for Joomfish. Remove the language segment from the url
    if (class_exists('JoomFishManager')) {
        $lang = JFactory::getLanguage();
        $language = $lang->getTag();
        $jfm = JoomFishManager::getInstance();
        $lang_shortcode = $jfm->getLanguageCode($language);
        if (strstr($uri, '/' . $lang_shortcode . '/')) {
            $uri = str_replace('/' . $lang_shortcode . '/', '/', $uri);
        }
    }
    $new_segments = cmsFramework::_parseSefRoute($uri);
    if (end($new_segments) == 'index.php') {
        $new_segments = $segments;
    }
    // Remove Joomla language segment from url
    if (isset($_GET['language']) && $_GET['language'] != '' && strlen($new_segments[0]) == 2) {
        $new_segments[0] = 'index.php';
    }
    # Fix for sef without mod rewrite. Without it the sort urls don't work.
    // Remove the Itemid related segments when mod rewrite is disabled and Itemid exists
    if ($new_segments[0] == 'index.php' && $new_segments[1] != 'component') {
        foreach ($new_segments as $key => $segment) {
            if (!in_array(str_replace(' ', '+', $segment), $segments) && !in_array(JreviewsStrReplaceOnce('-', ':', urlencode($segment)), $segments)) {
                unset($new_segments[$key]);
            }
        }
    }
    if (count($new_segments) >= 3 && isset($new_segments[0]) && $new_segments[0] == 'index.php' && isset($new_segments[1]) && $new_segments[1] == 'component' && isset($new_segments[2]) && $new_segments[2] == 'jreviews') {
        array_shift($new_segments);
        array_shift($new_segments);
        array_shift($new_segments);
    }
    $vars['url'] = implode('/', $new_segments);
    return $vars;
}
開發者ID:atikahmed,項目名稱:joomla-probid,代碼行數:40,代碼來源:router.php


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