酸甜苦辣是生命的富有,赤橙黄绿是人生的斑斓。低头走路只看到大地的厚重却忽略了高空的高远;抬头走路,只看到高空的广阔,却忽略了脚下的艰辛与险峻。
									           本文实例讲述了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框架的PHP程序设计有所帮助。
本文thinkPHP简单调用函数与类库的方法到此结束。梦的方向叫做闯小编再次感谢大家对我们的支持!
