本文整理汇总了PHP中Params::unsetParam方法的典型用法代码示例。如果您正苦于以下问题:PHP Params::unsetParam方法的具体用法?PHP Params::unsetParam怎么用?PHP Params::unsetParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Params
的用法示例。
在下文中一共展示了Params::unsetParam方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doModel
function doModel()
{
osc_run_hook('before_search');
if (osc_rewrite_enabled()) {
// IF rewrite is not enabled, skip this part, preg_match is always time&resources consuming task
$p_sParams = "/" . Params::getParam('sParams', false, false);
if (preg_match_all('|\\/([^,]+),([^\\/]*)|', $p_sParams, $m)) {
$l = count($m[0]);
for ($k = 0; $k < $l; $k++) {
switch ($m[1][$k]) {
case osc_get_preference('rewrite_search_country'):
$m[1][$k] = 'sCountry';
break;
case osc_get_preference('rewrite_search_region'):
$m[1][$k] = 'sRegion';
break;
case osc_get_preference('rewrite_search_city'):
$m[1][$k] = 'sCity';
break;
case osc_get_preference('rewrite_search_city_area'):
$m[1][$k] = 'sCityArea';
break;
case osc_get_preference('rewrite_search_category'):
$m[1][$k] = 'sCategory';
break;
case osc_get_preference('rewrite_search_user'):
$m[1][$k] = 'sUser';
break;
case osc_get_preference('rewrite_search_pattern'):
$m[1][$k] = 'sPattern';
break;
default:
// custom fields
if (preg_match("/meta(\\d+)-?(.*)?/", $m[1][$k], $results)) {
$meta_key = $m[1][$k];
$meta_value = $m[2][$k];
$array_r = array();
if (Params::existParam('meta')) {
$array_r = Params::getParam('meta');
}
if ($results[2] == '') {
// meta[meta_id] = meta_value
$meta_key = $results[1];
$array_r[$meta_key] = $meta_value;
} else {
// meta[meta_id][meta_key] = meta_value
$meta_key = $results[1];
$meta_key2 = $results[2];
$array_r[$meta_key][$meta_key2] = $meta_value;
}
$m[1][$k] = 'meta';
$m[2][$k] = $array_r;
}
break;
}
Params::setParam($m[1][$k], $m[2][$k]);
}
Params::unsetParam('sParams');
}
}
$uriParams = Params::getParamsAsArray();
$searchUri = osc_search_url($uriParams);
if ($this->uri != 'feed') {
if (str_replace("%20", '+', $searchUri) != str_replace("%20", '+', WEB_PATH . $this->uri)) {
$this->redirectTo($searchUri, 301);
}
}
////////////////////////////////
//GETTING AND FIXING SENT DATA//
////////////////////////////////
$p_sCategory = Params::getParam('sCategory');
if (!is_array($p_sCategory)) {
if ($p_sCategory == '') {
$p_sCategory = array();
} else {
$p_sCategory = explode(",", $p_sCategory);
}
}
$p_sCityArea = Params::getParam('sCityArea');
if (!is_array($p_sCityArea)) {
if ($p_sCityArea == '') {
$p_sCityArea = array();
} else {
$p_sCityArea = explode(",", $p_sCityArea);
}
}
$p_sCity = Params::getParam('sCity');
if (!is_array($p_sCity)) {
if ($p_sCity == '') {
$p_sCity = array();
} else {
$p_sCity = explode(",", $p_sCity);
}
}
$p_sRegion = Params::getParam('sRegion');
if (!is_array($p_sRegion)) {
if ($p_sRegion == '') {
$p_sRegion = array();
} else {
$p_sRegion = explode(",", $p_sRegion);
//.........这里部分代码省略.........