当前位置: 首页>>代码示例>>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;未经允许,请勿转载。