发布于 2017-07-26 03:35:07 | 136 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的精品教程,程序狗速度看过来!

ThinkPHP开源PHP框架

ThinkPHP是一个开源的PHP框架,是为了简化企业级应用开发和敏捷WEB应用开发而诞生的。ThinkPHP可以支持windows/Unix/Liunx等服务器环境,正式版需要PHP5.0以上版本支持,支持MySql、PgSQL、Sqlite以及PDO等多种数据库


这篇文章主要介绍了thinkPHP简单调用函数与类库的方法,简单讲述了thinkPHP公共函数库的文件位置并结合实例分析了类库的调用方法,需要的朋友可以参考下

本文实例讲述了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程序设计有所帮助。



最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务