feat: 模板区分pc与mobile

This commit is contained in:
2025-05-22 18:05:49 +08:00
parent c1e760795c
commit 983aed0019
147 changed files with 5104 additions and 14 deletions

View File

@@ -2,6 +2,10 @@
// +----------------------------------------------------------------------
// | 模板设置
// +----------------------------------------------------------------------
$view_deivce_name = 'pc';
if (request()->isMobile()) {
$view_deivce_name = 'mobile';
}
return [
// 模板引擎类型使用Think
@@ -9,7 +13,7 @@ return [
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
'auto_rule' => 1,
// 模板目录名
'view_dir_name' => 'view',
'view_dir_name' => "view/{$view_deivce_name}",
// 模板后缀
'view_suffix' => 'html',
// 模板文件名分隔符
@@ -24,8 +28,8 @@ return [
'taglib_end' => '}',
// 模板输出替换
'tpl_replace_string' => [
'__CSS__' => '/static/index/css',
'__JS__' => '/static/index/js',
'__IMAGES__' => '/static/index/images',
'__CSS__' => "/static/index/{$view_deivce_name}/css",
'__JS__' => "/static/index/{$view_deivce_name}/js",
'__IMAGES__' => "/static/index/{$view_deivce_name}/images",
]
];