phpcms关于url路由在二次开发中的使用方法介绍-实现泛解析
//二级域名泛解析后的处理
function domain(){
$domain = getcache('domain','commons');
$domain_data = $domain[$GLOBALS['domain']];
if( !empty($domain_data) ){
return parse_domain($domain_data) ;
}
else{
header("HTTP/1.1 404 Not Found");
header("Status: 404 Not Found");
$db = pc_base::load_model('http404_model');
$db->add();
echo file_get_contents(PHPCMS_PATH.'404.htm');
}
}
function parse_domain($array){
switch($array['type']){
case '3833'://手术项目,也即栏目
$catid = $array['keyid'];
$id = $_GET['id'];
$GET = $id ? array('id'=>$id,'catid'=>$catid) : array('catid'=>$catid);
$newarr = array('m'=>'content','c'=>'index','a'=>$id ? 'show': 'lists','data'=>array('GET'=>$GET));
$GLOBALS['catid'] = $catid;
break;
case '3834'://城市地区
$newarr = array('m'=>'content','c'=>'city','a'=>'init','data'=>array('GET'=>array('areaid'=>$array['keyid'])));
$GLOBALS['cityid'] = $array['keyid'];
break;
case '3835'://整形医院
$newarr = array('m'=>'yp','c'=>'com_index','a'=>'init','data'=>array('GET'=>array('userid'=>$array['keyid'])));
$GLOBALS['hospitalid'] = $array['keyid'];
break;
}
return $newarr;
}
本站资源均来自互联网或会员发布,如果不小心侵犯了您的权益请与我们联系。我们将立即删除!谢谢!