前端模板增加主题管理
This commit is contained in:
@@ -24,10 +24,32 @@ class Fornt extends Base {
|
||||
$this->setSeo();
|
||||
|
||||
$this->setHoverNav();
|
||||
|
||||
//主题设置
|
||||
$this->setThemes();
|
||||
}
|
||||
|
||||
//当前栏目导航
|
||||
protected function setHoverNav() {
|
||||
//dump($_SERVER['PHP_SELF']);
|
||||
}
|
||||
|
||||
protected function setThemes() {
|
||||
//网站主题设置
|
||||
$themes['mobile'] = config('mobile_themes') ? config('mobile_themes') : 'default';
|
||||
$themes['pc'] = config('pc_themes') ? config('pc_themes') : 'default';
|
||||
$view_path = $this->isMobile() ? 'template/mobile/' . $themes['mobile'] . '/' : 'template/pc/' . $themes['pc'] . '/';
|
||||
$module = $this->request->module();
|
||||
if (!in_array($module, array('index', 'install'))) {
|
||||
$view_path_pre = $module . '/';
|
||||
} else {
|
||||
$view_path_pre = '';
|
||||
}
|
||||
$this->view->config('view_path', $view_path . $view_path_pre)
|
||||
->config('tpl_replace_string',array(
|
||||
'__IMG__' => '/' . $view_path . 'static/images',
|
||||
'__JS__' => '/' . $view_path . 'static/js',
|
||||
'__CSS__' => '/' . $view_path . 'static/css',
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user