refactor: 设置模板输出替换

This commit is contained in:
2025-04-12 17:26:51 +08:00
parent abbd36c84d
commit 03b7e0d288
7 changed files with 49 additions and 18 deletions

31
app/index/config/view.php Normal file
View File

@@ -0,0 +1,31 @@
<?php
// +----------------------------------------------------------------------
// | 模板设置
// +----------------------------------------------------------------------
return [
// 模板引擎类型使用Think
'type' => 'Think',
// 默认模板渲染规则 1 解析为小写+下划线 2 全部转换小写 3 保持操作方法
'auto_rule' => 1,
// 模板目录名
'view_dir_name' => 'view',
// 模板后缀
'view_suffix' => 'html',
// 模板文件名分隔符
'view_depr' => DIRECTORY_SEPARATOR,
// 模板引擎普通标签开始标记
'tpl_begin' => '{',
// 模板引擎普通标签结束标记
'tpl_end' => '}',
// 标签库标签开始标记
'taglib_begin' => '{',
// 标签库标签结束标记
'taglib_end' => '}',
// 模板输出替换
'tpl_replace_string' => [
'__CSS__' => '/static/index/css',
'__JS__' => '/static/index/js',
'__IMAGES__' => '/static/index/images',
]
];

View File

@@ -11,7 +11,7 @@
{/notempty} {/notempty}
{/block} {/block}
{block name="style"} {block name="style"}
<link rel="stylesheet" href="/static/index/css/articleDetail.css"> <link rel="stylesheet" href="__CSS__/articleDetail.css">
{/block} {/block}
{block name="main"} {block name="main"}
<div class="orico_Page_articleDetail"> <div class="orico_Page_articleDetail">
@@ -30,16 +30,16 @@
<h3>{:lang('article.detail_share')}</h3> <h3>{:lang('article.detail_share')}</h3>
<div class="share_list clearfix"> <div class="share_list clearfix">
<a class="atdit" target="_blank" href="https://weibo.com/"> <a class="atdit" target="_blank" href="https://weibo.com/">
<img src="/static/index/images/share1.png" /> <img src="__IMAGES__/share1.png" />
</a> </a>
<a class="atdit"> <a class="atdit">
<img src="/static/index/images/share2.png" /> <img src="__IMAGES__/share2.png" />
</a> </a>
<a class="atdit" target="_blank" href="https://creator.xiaohongshu.com/login?redirectReason=401"> <a class="atdit" target="_blank" href="https://creator.xiaohongshu.com/login?redirectReason=401">
<img src="/static/index/images/share3.png" /> <img src="__IMAGES__/share3.png" />
</a> </a>
<a class="atdit" href="javascript:shareCustomers();"> <a class="atdit" href="javascript:shareCustomers();">
<img src="/static/index/images/share4.png" /> <img src="__IMAGES__/share4.png" />
</a> </a>
</div> </div>
</div> </div>
@@ -64,7 +64,7 @@
<div class="love"> <div class="love">
<div class="love1"> <div class="love1">
<p class="tt">{:lang('article.detail_recommend')}</p> <p class="tt">{:lang('article.detail_recommend')}</p>
<p><img src="/static/index/images/1line.png" height="7"></p> <p><img src="__IMAGES__/1line.png" height="7"></p>
</div> </div>
<ul class="love2"> <ul class="love2">
{volist name="recommends" id="vo"} {volist name="recommends" id="vo"}

View File

@@ -1,6 +1,6 @@
{extend name="public/base" /} {extend name="public/base" /}
{block name="style"} {block name="style"}
<link rel="stylesheet" type="text/css" href="/static/index/css/category.css" /> <link rel="stylesheet" type="text/css" href="__CSS__/category.css" />
{/block} {/block}
{block name="main"} {block name="main"}
<div class="orico_Page_category"> <div class="orico_Page_category">

View File

@@ -1,6 +1,6 @@
{extend name="public/base" /} {extend name="public/base" /}
{block name="style"} {block name="style"}
<link rel="stylesheet" type="text/css" href="static/index/css/index.css" /> <link rel="stylesheet" type="text/css" href="__CSS__/index.css" />
{/block} {/block}
{block name="main"} {block name="main"}
<div class="orico_Page_index"> <div class="orico_Page_index">

View File

@@ -8,10 +8,10 @@
<meta name="description" content="{$basic_config['website_seo_description']['value']}" /> <meta name="description" content="{$basic_config['website_seo_description']['value']}" />
{/block} {/block}
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="/static/index/css/public.css" /> <link rel="stylesheet" type="text/css" href="__CSS__/public.css" />
<link rel="stylesheet" type="text/css" href="/static/index/css/fonts.css" /> <link rel="stylesheet" type="text/css" href="__CSS__/fonts.css" />
<link rel="stylesheet" type="text/css" href="/static/index/css/orico_header.css" /> <link rel="stylesheet" type="text/css" href="__CSS__/orico_header.css" />
<link rel="stylesheet" type="text/css" href="/static/index/css/orico_footer.css" /> <link rel="stylesheet" type="text/css" href="__CSS__/orico_footer.css" />
{block name="style"}{/block} {block name="style"}{/block}
<link rel="stylesheet" href="https://unpkg.com/swiper@9/swiper-bundle.min.css"> <link rel="stylesheet" href="https://unpkg.com/swiper@9/swiper-bundle.min.css">
<script type="text/javascript" src='https://code.jquery.com/jquery-3.6.0.min.js'></script> <script type="text/javascript" src='https://code.jquery.com/jquery-3.6.0.min.js'></script>

View File

@@ -6,7 +6,7 @@
<div class="foottxttop"> <div class="foottxttop">
<!--ico --> <!--ico -->
<a href="/"> <a href="/">
<img src="/static/index/images/bottomlogo.png" class="footerico" /> <img src="__IMAGES__/bottomlogo.png" class="footerico" />
</a> </a>
<div class="foootCt"> <div class="foootCt">
<p class="ftitle">{:lang('footer_navigation.product_categorys')}</p> <p class="ftitle">{:lang('footer_navigation.product_categorys')}</p>

View File

@@ -3,7 +3,7 @@
<!-- LOG --> <!-- LOG -->
<div class="nav1"> <div class="nav1">
<a> <a>
<img src="/static/index/images/logo.png" /> <img src="__IMAGES__/logo.png" />
</a> </a>
</div> </div>
<!--顶部导航栏 --> <!--顶部导航栏 -->
@@ -13,7 +13,7 @@
{if condition="!empty($header_categorys)"} {if condition="!empty($header_categorys)"}
<li class="navItem"> <li class="navItem">
<a href="javascript:void(0);">{:lang('header_navigation.product_categorys')}</a> <a href="javascript:void(0);">{:lang('header_navigation.product_categorys')}</a>
<img src="/static/index/images/black-down.png" class="downimg" /> <img src="__IMAGES__/black-down.png" class="downimg" />
<ol class="navItemConten"> <ol class="navItemConten">
<!-- 左边子菜单--> <!-- 左边子菜单-->
<ul class="navItem_cyleft"> <ul class="navItem_cyleft">
@@ -50,7 +50,7 @@
<li class="navItem"> <li class="navItem">
<a href="{$vo.link}" target="{$vo.blank==1?'_blank':'_self'}">{$vo.name}</a> <a href="{$vo.link}" target="{$vo.blank==1?'_blank':'_self'}">{$vo.name}</a>
{if condition="!empty($vo.children)"} {if condition="!empty($vo.children)"}
<img src="/static/index/images/black-down.png" class="downimg" /> <img src="__IMAGES__/black-down.png" class="downimg" />
<!--下拉菜单 --> <!--下拉菜单 -->
<ol class="navItemConten1"> <ol class="navItemConten1">
{volist name="vo.children" id="voc"} {volist name="vo.children" id="voc"}
@@ -67,9 +67,9 @@
</div> </div>
<!-- 顶部搜索/国家选择/商店--> <!-- 顶部搜索/国家选择/商店-->
<div class="nav3"> <div class="nav3">
<img src="/static/index/images/icon-search.png" id="openModalBtn" class="searchimg" /> <img src="__IMAGES__/icon-search.png" id="openModalBtn" class="searchimg" />
<div class="choesCountry"> <div class="choesCountry">
<img src="/static/index/images/icon-language.png" id="countrycheck" class="checkimg" /> <img src="__IMAGES__/icon-language.png" id="countrycheck" class="checkimg" />
<!--国家选择 --> <!--国家选择 -->
<div class="topCountry" id="top-country"> <div class="topCountry" id="top-country">
<ul> <ul>