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