1、完善前端模板功能

2、完善伪静态规则设置
This commit is contained in:
2020-04-17 16:46:32 +08:00
parent ce9b63dda1
commit 83ce571a3f
6 changed files with 135 additions and 57 deletions

View File

@@ -42,11 +42,11 @@ class Base extends BaseC {
if ($this->isMobile() && $config['mobile_themes']) {
$mobile_themes = $config['mobile_themes'] ? $config['mobile_themes'] . DIRECTORY_SEPARATOR : "";
$this->tpl_config['view_dir_name'] = 'public' . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . $mobile_themes;
if (!is_dir($this->app->getRootPath() . $this->tpl_config['view_dir_name'])) {
if (!file_exists($this->app->getRootPath() . $this->tpl_config['view_dir_name'])) {
$this->tpl_config['view_dir_name'] = 'public' . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . $pc_themes;
}
}
if(!is_dir($this->app->getRootPath() . $this->tpl_config['view_dir_name'])){
if(!file_exists($this->app->getRootPath() . $this->tpl_config['view_dir_name'] . DIRECTORY_SEPARATOR . 'user')){
$this->tpl_config['view_dir_name'] = 'public' . DIRECTORY_SEPARATOR . 'template' . DIRECTORY_SEPARATOR . 'default';
}
if ($template == '') {
@@ -55,11 +55,11 @@ class Base extends BaseC {
$template_path = str_replace("public", "", $this->tpl_config['view_dir_name']);
$this->tpl_config['tpl_replace_string'] = [
'__static__' => '/static',
'__img__' => $template_path . 'static/images',
'__css__' => $template_path . 'static/css',
'__js__' => $template_path . 'static/js',
'__img__' => $template_path . DIRECTORY_SEPARATOR . 'static/images',
'__css__' => $template_path . DIRECTORY_SEPARATOR . 'static/css',
'__js__' => $template_path . DIRECTORY_SEPARATOR . 'static/js',
'__plugins__' => '/static/plugins',
'__public__' => $template_path . 'static',
'__public__' => $template_path . DIRECTORY_SEPARATOR . 'static',
];
View::config($this->tpl_config);