thinkPHP简单调用函数与类库的方法
本文实例讲述了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();
}
}
更多关于thinkPHP相关内容感兴趣的读者可查看本站专题:《ThinkPHP入门教程》、《thinkPHP模板操作技巧总结》、《ThinkPHP常用方法总结》、《codeigniter入门教程》、《CI(CodeIgniter)框架进阶教程》、《ZendFrameWork框架入门教程》、《smarty模板入门基础教程》及《PHP模板技术总结》。
希望本文所述对大家基于ThinkPHP框架的PHP程序设计有所帮助。
热门推荐
6 保研的祝福语简短
10 年轻20岁祝福语简短
11 朋友结婚祝福语信息简短
12 女孩婚礼贺卡祝福语简短
13 30段点歌简短祝福语
14 虎年春节祝福语图文简短
15 写给后妈祝福语大全简短
16 简短回复生日祝福语
17 校长送毕业祝福语简短
18 毕业立体贺卡祝福语简短