发布于 2017-07-26 03:35:07 | 136 次阅读 | 评论: 0 | 来源: 网友投递
ThinkPHP开源PHP框架
ThinkPHP是一个开源的PHP框架,是为了简化企业级应用开发和敏捷WEB应用开发而诞生的。ThinkPHP可以支持windows/Unix/Liunx等服务器环境,正式版需要PHP5.0以上版本支持,支持MySql、PgSQL、Sqlite以及PDO等多种数据库
本文实例讲述了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程序设计有所帮助。