当前位置: 首页>>代码示例>>PHP>>正文


PHP cmsFramework::_getUri方法代码示例

本文整理汇总了PHP中cmsFramework::_getUri方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsFramework::_getUri方法的具体用法?PHP cmsFramework::_getUri怎么用?PHP cmsFramework::_getUri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cmsFramework的用法示例。


在下文中一共展示了cmsFramework::_getUri方法的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::_getUri方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。