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


PHP DiscussRouter::isSefEnabled方法代碼示例

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


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

示例1: getFeedURL

 public function getFeedURL($url, $atom = false)
 {
     require_once DISCUSS_HELPERS . '/router.php';
     $sef = DiscussRouter::isSefEnabled();
     $join = $sef ? '?' : '&';
     $url = DiscussRouter::_($url) . $join . 'format=feed';
     $url .= $atom ? '&type=atom' : '&type=rss';
     return $url;
 }
開發者ID:BetterBetterBetter,項目名稱:B3App,代碼行數:9,代碼來源:feeds.php

示例2: getRoutedURL

 public static function getRoutedURL($url, $xhtml = false, $external = false)
 {
     if (!$external) {
         return DiscussRouter::_($url, $xhtml);
     }
     $mainframe = JFactory::getApplication();
     $uri = JURI::getInstance(JURI::base());
     //To fix 1.6 Jroute issue as it will include the administrator into the url path.
     $url = str_replace('/administrator/', '/', DiscussRouter::_($url, $xhtml));
     if ($mainframe->isAdmin() && DiscussRouter::isSefEnabled()) {
         if (DiscussHelper::getJoomlaVersion() >= '1.6') {
             JFactory::$application = JApplication::getInstance('site');
         }
         if (DiscussHelper::getJoomlaVersion() >= '3.0') {
             jimport('joomla.libraries.cms.router');
         } else {
             jimport('joomla.application.router');
             require_once JPATH_ROOT . '/includes/router.php';
             require_once JPATH_ROOT . '/includes/application.php';
         }
         $router = new JRouterSite(array('mode' => JROUTER_MODE_SEF));
         $urls = $router->build($url)->toString(array('path', 'query', 'fragment'));
         $urls = DISCUSS_JURIROOT . '/' . ltrim(str_replace('/administrator/', '/', $urls), '/');
         $container = explode('/', $urls);
         $container = array_unique($container);
         $urls = implode('/', $container);
         if (DiscussHelper::getJoomlaVersion() >= '1.6') {
             JFactory::$application = JApplication::getInstance('administrator');
         }
         return $urls;
     } else {
         $url = rtrim($uri->toString(array('scheme', 'host', 'port')), '/') . '/' . ltrim($url, '/');
         $url = str_replace('/administrator/', '/', $url);
         if (DiscussRouter::isSefEnabled()) {
             $container = explode('/', $url);
             $container = array_unique($container);
             $url = implode('/', $container);
         }
         return $url;
     }
 }
開發者ID:BetterBetterBetter,項目名稱:B3App,代碼行數:41,代碼來源:router.php


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