最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
thinkPHP简单调用函数与类库的方法
时间:2022-06-25 02:23:17 编辑:袖梨 来源:一聚教程网
本文实例讲述了thinkPHP调用函数与类库的方法。分享给大家供大家参考,具体如下:
手册上说的很冗余,没看懂,下面简单的讲一下具体用法。
函数调用:
lib公共函数库叫common.php
App/common/common.php
分组模块下的公共函数库叫function.php
App/Modules/Admin/common/function.php
类库调用:
| 代码如下 | 复制代码 |
classIndexActionextendsAction{ publicfunctionindex(){ // 调用“扩展基类库” ThinkPHP/Extend/Library/ORG/Util/Test.class.php import('ORG.Util.Test'); $test=newTest(); // 调用“扩展基类库” ThinkPHP/Extend/Library/Com/Util/Test.class.php import('Com.Util.Test'); $test=newTest(); // 调用“核心基类库” ThinkPHP/Lib/Core/Test.class.php import('Think.Core.Test'); $test=newTest(); $this->display(); } } | |
相关文章
- 如何在AE中创建文字蒙版动画效果 05-23
- 泰到位上门服务正规吗-泰到位app暗号全揭秘 05-23
- 史莱姆无限进化何时开启公测 05-23
- 王者荣耀世界商城氪金物品一览-王者荣耀世界商城付费道具全面解析 05-23
- 开放空间角色解析:开放空间常见角色类型介绍 05-23
- 求生之战大逃杀礼包指南:最新礼包与激活码获取攻略 05-23