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


PHP shRouter::build方法代碼示例

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


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

示例1: _sh404Sef

 /**
  * Create sh404SEF URLs
  *
  * @copyright
  * @author 		RolandD
  * @todo
  * @see 		http://dev.anything-digital.com/sh404SEF/
  * @see			getSiteRoute()
  * @access 		private
  * @param 		string	$url	the original URL to turn into SEF
  * @return 		string SEF URL
  * @since 		3.0
  */
 private function _sh404Sef($url)
 {
     // Load sh404SEF
     require_once JPATH_ADMINISTRATOR . '/components/com_sh404sef/sh404sef.class.php';
     $sefConfig = shRouter::shGetConfig();
     // Turn off any security and flooding setting
     $sefConfig->shSecEnableSecurity = 0;
     $sefConfig->shSecActivateAntiFlood = 0;
     // Require some necessary files
     require_once JPATH_ROOT . '/components/com_sh404sef/shCache.php';
     require_once JPATH_ROOT . '/components/com_sh404sef/shSec.php';
     // Start the sh404sef Router
     if (class_exists('shRouter')) {
         $shRouter = new shRouter();
     } else {
         return $this->_domainname . '/' . $url;
     }
     // Force the domain name
     $GLOBALS['shConfigLiveSite'] = $this->_domainname;
     // Initialize sh404sef
     include_once JPATH_ROOT . '/components/com_sh404sef/shInit.php';
     // Build the SEF URL
     $uri = $shRouter->build($url);
     $sefurl = $uri->toString();
     if (strpos($sefurl, 'http://') === false) {
         $sefurl = str_ireplace('http:/', 'http://', $sefurl);
     }
     return $sefurl;
 }
開發者ID:spiridonov-oa,項目名稱:SheinCandles,代碼行數:42,代碼來源:csvisef.php

示例2: header

     $sefConfig->page404 == '0';
 }
 // configuration values carried over when upgrading
 if ($sefConfig->page404 == '0') {
     $sql = 'SELECT id  FROM #__content WHERE `title`="__404__"';
     $database->setQuery($sql);
     if ($id = $database->loadResult()) {
     } else {
         JError::raiseError(404, JText::_('Component Not Found') . $mosmsg);
     }
 } else {
     $id = $sefConfig->page404;
 }
 $vars['id'] = $id;
 $shPageInfo->QUERY_STRING = 'option=com_content&view=article&id=' . $id . (empty($vars['Itemid']) ? '' : '&Itemid=' . $vars['Itemid']);
 $uri = shRouter::build($GLOBALS['shConfigLiveSite'] . '/index.php?' . $shPageInfo->QUERY_STRING);
 $shPageInfo->shCurrentPageNonSef = 'index.php?' . $shPageInfo->QUERY_STRING;
 $tmpl = str_replace('.php', '', $sefConfig->error404SubTemplate);
 if (!empty($tmpl)) {
     $vars['tmpl'] = $tmpl;
 }
 if (!headers_sent()) {
     header('HTTP/1.0 404 NOT FOUND');
     // V x : include error page, faster than loading Joomla 404 page. Not recommended though, why not show
     // your site ?
     if (is_readable(sh404SEF_FRONT_ABS_PATH . '404-Not-Found.tpl.html')) {
         $errorPage = file_get_contents(sh404SEF_FRONT_ABS_PATH . '404-Not-Found.tpl.html');
         if ($errorPage !== false) {
             $errorPage = str_replace('%sh404SEF_404_URL%', $vars['mosmsg'], $errorPage);
             $errorPage = str_replace('%sh404SEF_404_SITE_URL%', $GLOBALS['shConfigLiveSite'], $errorPage);
             $errorPage = str_replace('%sh404SEF_404_SITE_NAME%', $mainframe->getCfg('sitename'), $errorPage);
開發者ID:justinlyon,項目名稱:scc,代碼行數:31,代碼來源:sh404sef.inc.php


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