thinkphp5中的配置文件详解
2022-07-28 14:14:58
230
{{single.collect_count}}

tp5与tp3 的全局配置变量不一样
tp3中使用的是C方法 【参考tp3中C方法配置请点击】
tp5使用的是config方法

在这里插入图片描述

ThinkPHP5扩展配置目录extra中自定义配置文件的管理方法

方法位置/thinkphp/library/think/Config/—get方法 【可不管】
配置文件位置application/extra/文件名.php

可以新建php文件作为配置方法
site.php内容展示
在这里插入图片描述
//使用

use think\Config;$menu = Config(‘文件名’);//获取里面返回的数组$menu = Config('site');//获取具体内容echo $menu['name']//或者echo Config('site.name')
回帖
全部回帖({{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 ? '加载中...' : '查看更多评论'}}