thinkphp6.0.9 模板常量 static 静态资源路径配置
2023-03-29 23:03:03
143
{{single.collect_count}}

打开文件 config/view.php 添加

// 模板引用静态资源路径'tpl_replace_string' => ['{__STATIC__}' => '/static','{__CSS__}' => '/static/css','{__JS__}' => '/static/js','{__IMG__}' => '/static/img',],

.html 模板引用格式

<link rel="stylesheet" href="{__STATIC__}/CSS/index.css" /><link rel="stylesheet" href="{__CSS__}/index.css" /><script type="text/JavaScript" src="{__JS__}/js/function.js"></script>

thinkphp6 需要使用 { }

'{__STATIC__}' => '/static',

thinkphp5 不需要 { }

'__STATIC__' => '/static',
回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}