0
回答
php判断手机访问,默认模板是web目录,改成:判断是不是手机访问,如果是就选择mobile模板
终于搞明白,存储TCO原来是这样算的>>>   
php判断手机访问,默认模板是web目录,改成:判断是不是手机访问,如果是就选择mobile模板

<?php
namespace Home\Controller;
use Think\Controller;
use Com\WechatAuth;

class WapController extends Controller {

public function _empty(){
$this->redirect("./web/index.html");
}

protected function _initialize(){
$config = S('DB_CONFIG_DATA');
if(!$config){
$config = config_lists();
S('DB_CONFIG_DATA'$config);
}
C($config);
$this->web_path=__ROOT__."/";
$this->web_title=C("WEB_SITE_title");
$this->web_logo="/".C('TMPL_PATH')."/web/images/".C("WEB_LOGO");
$this->web_keywords=C("WEB_SITE_KEYWORD");
$this->web_description=C("WEB_SITE_DEscriptION");
$this->web_icp=C("WEB_SITE_ICP");
$this->web_url=C("WEB_URL");
$this->web_currency=C("WEB_CURRENCY");
$this->wx_pay=C('WX_PAY_MCHID');
$this->ali_pay=C('ALI_PAY_PARTNER');
$this->band_pay=C('BAND_PAY_MID');
$this->yun_pay=C('YUN_PAY_ID');
$this->pay_pal=C('PAY_PAL');
$this->web_time=NOW_TIME;
activity(3''UID);
$this->tplpath="./".C('TMPL_PATH')."/web/";
$this->web_tplpath=$this->web_path.C('TMPL_PATH')."/web/";
C('CACHE_PATH'RUNTIME_PATH."/Cache/".MODULE_NAME."/web/");
define('UID'is_login());
$user_auth=session('user_auth');
$this->username=$user_auth['username'];
}
}
举报
qqaiamin
发帖于11个月前 0回/117阅
顶部