首页  >  文章  >  后端开发  >  thinkPHP简单调用函数与类库

thinkPHP简单调用函数与类库

WBOY
WBOY原创
2018-04-08 09:59:121682浏览

函数调用:

lib公共函数库叫 common.php

App/common/common.php

分组模块下的公共函数库叫 function.php

App/Modules/Admin/common/function.php

类库调用:

class IndexAction extends Action{
 public function index(){
  // 调用“扩展基类库” ThinkPHP/Extend/Library/ORG/Util/Test.class.php
  import('ORG.Util.Test');
  $test = new Test();
  // 调用“扩展基类库” ThinkPHP/Extend/Library/Com/Util/Test.class.php
  import('Com.Util.Test');
  $test = new Test();
  // 调用“核心基类库” ThinkPHP/Lib/Core/Test.class.php
  import('Think.Core.Test');
  $test = new Test();
  $this->display();
 }
}


以上是thinkPHP简单调用函数与类库的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn