前端模板增加主题管理

This commit is contained in:
2016-11-25 13:55:03 +08:00
parent 06906a5b22
commit 2bb2af2c0c
46 changed files with 265 additions and 106 deletions
+22
View File
@@ -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',
));
}
}