本文整理汇总了PHP中fURL::convertGetToPath方法的典型用法代码示例。如果您正苦于以下问题:PHP fURL::convertGetToPath方法的具体用法?PHP fURL::convertGetToPath怎么用?PHP fURL::convertGetToPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fURL
的用法示例。
在下文中一共展示了fURL::convertGetToPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderURL
//.........这里部分代码省略.........
/**
* trim first ampersand
*/
if (strpos($_vars, '&') === 0) {
$_vars = substr($_vars, 1, strlen($_vars) - 1);
}
/**
* Render new get-tokens
*/
$ReceivedTokens = array();
$r_TokenStrs = explode('&', $_vars);
$widgets_token = false;
foreach ($r_TokenStrs as $TokenStr) {
$r_Token = explode('=', $TokenStr, 2);
if ($r_Token[0] == 'widgets') {
$widgets_token = true;
}
if ($r_Token[0] == 'store_mode') {
$mode_token = true;
}
if (isset($r_Token[1]) && strlen($r_Token[1])) {
$ReceivedTokens[$r_Token[0]] = $r_Token[1];
if ($Mode == URLRENDMODE_MODIFY) {
$GetVars[$r_Token[0]] = $r_Token[1];
}
} else {
switch ($Mode) {
case URLRENDMODE_MODIFY:
if (isset($GetVars[$r_Token[0]])) {
unset($GetVars[$r_Token[0]]);
}
break;
case URLRENDMODE_RESET:
if (isset($GetVars[$r_Token[0]]) && $r_Token[0] != 'product_slug' && $r_Token[0] != 'category_slug') {
$ReceivedTokens[$r_Token[0]] = $GetVars[$r_Token[0]];
}
break;
}
}
}
/**
* Render URL
*/
$newGetVars = array();
switch ($Mode) {
case URLRENDMODE_MODIFY:
$newGetVars =& $GetVars;
break;
case URLRENDMODE_RESET:
$newGetVars =& $ReceivedTokens;
break;
}
if (!$mode_token) {
$Register =& Register::getInstance();
if ($store_mode = $Register->get('store_mode')) {
$newGetVars['store_mode'] = $store_mode;
}
}
if (!MOD_REWRITE_SUPPORT) {
foreach (array('product_slug', 'category_slug') as $param) {
if (isset($newGetVars[$param])) {
unset($newGetVars[$param]);
}
}
}
if (!$widgets_token && count($newGetVars)) {
$Register =& Register::getInstance();
/*@var $Register Register*/
if ($Register->get('widgets')) {
$newGetVars['widgets'] = 1;
}
}
if ($_store) {
$_GET = $newGetVars;
}
if (class_exists('fURL') && $furl !== false) {
fURL::convertGetToPath($_request, $newGetVars);
}
foreach ($newGetVars as $TokenName => $TokenValue) {
$newGetVars[$TokenName] = $TokenName . '=' . $TokenValue;
}
$RenderedURL = implode('&', $newGetVars);
if (strpos($_request, '?') !== false) {
$RenderedURL = preg_replace('/\\?.*$/', '?' . $RenderedURL, $_request);
} else {
$RenderedURL = $_request . '?' . $RenderedURL;
}
$RenderedURL = preg_replace('@[\\?\\&]{1,2}$@', '', $RenderedURL);
$RenderedURL = preg_replace('@^/{2,}@', '/', $RenderedURL);
if (strlen($anchor) > 1) {
$RenderedURL = preg_replace('@#[^#]*$@', '', $RenderedURL) . $anchor;
}
/**
* Strore URL
*/
if ($_store) {
// $_SERVER['REQUEST_URI'] = $RenderedURL;
}
return $RenderedURL;
}