thinkphp5引入调用外部类
2022-07-28 14:14:58
112
{{single.collect_count}}

1. 将外部类放到extends文件夹下

2.观察外部类文件的命名空间

 

3. 在需要引用该类文件的php代码中,引入该文件

注意,前面为命名空间,后面为类的名字

4. 绿线的地方写该类文件在extends文件夹中的路径,不带后缀;

黄线的地方不加”\"

 

5. 调用IPFS类中的一个函数

最后输出

 

注意:如果引用的类文件没有命名空间,则参考:https://blog.csdn.net/weixin_41764619/article/details/84927213

回帖
全部回帖({{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 ? '加载中...' : '查看更多评论'}}