当前位置: 移动技术网 > IT编程>开发语言>PHP > thinkPHP简单调用函数与类库的方法

thinkPHP简单调用函数与类库的方法

2017年12月12日  | 移动技术网IT编程  | 我要评论

本文实例讲述了thinkphp调用函数与类库的方法。分享给大家供大家参考,具体如下:

手册上说的很冗余,没看懂,下面简单的讲一下具体用法。

函数调用:

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相关内容感兴趣的读者可查看本站专题:《thinkphp入门教程》、《thinkphp模板操作技巧总结》、《thinkphp常用方法总结》、《codeigniter入门教程》、《ci(codeigniter)框架进阶教程》、《zend framework框架入门教程》、《smarty模板入门基础教程》及《php模板技术总结》。

希望本文所述对大家基于thinkphp框架的php程序设计有所帮助。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网