Sian 发表于 2016-3-8 20:13:03

1、环境搭建及基本使用

本帖最后由 Sian 于 2016-3-8 20:17 编辑

1、下载框架源文件:http://www.thinkphp.cn/down.html 下载核心版即可;
2、将下载的压缩包解压缩,找到里面的ThinkPHP目录拷贝到Web服务器的根目录(前提条件是已经搭建好了支持php的web服务器);
3、在服务器根目录新建index.php文件;
<?php
      define('APP_PATH', './Sink/');
      require('./ThinkPHP/ThinkPHP.php');4、访问index.php文件
5、网站根目录会自动生成一个Sink文件夹;
6、网站目录结构
|--index.php
|--Sink
|   |----Common
|   |----Home
|   |      |----index.html
|   |      |----Common
|   |      |----Conf
|   |      |----Controller
|   |      |          |----index.html
|   |      |          |----IndexController.class.php
|   |      |----Model
|   |      |----View
|   |----Runtime
|--ThinkPHP
7、IndexController.class.php
<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
    public function index(){
            echo "Hello World!!";
    }
}将原文件中index()方法中的内容删除改成上述内容即可更改首页内容
8、访问首页链接为http://www.xxxx.com/
实际访问为http://www.xxx.com/index.php
实际访问为http://www.xxx.com/index.php/Home/Index/index
结构为http://域名/入口文件/模块名/接口名/方法名
9、源代码下载:
**** Hidden Message *****
页: [1]
查看完整版本: 1、环境搭建及基本使用