好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

ThinkPHP在eclipse使用 - Thinkphp

ThinkPHP在eclipse使用

1)在eclipse中创建项目case01目录设置wmp的www目录之下

2)将ThinkPhp下载下来,解压,并将文件拷入新建的项目下面,此时,已经可以访问这个项目了.

http://localhost/case01/

http://localhost/case01/index.php

http://localhost/case01/index.php/Home

http://localhost/case01/index.php/Home/Index

这些路径都是可以访问的.

3)我们在eclipse的case01项目的刷新一下,Application下面会新增很多的文件,修改一下Application/Home/Controller下面的IndexController.class.php文件,增加一个: 

public function test(){

echo 'test';

}

通过路径:http://localhost/case01/index.php/Home/Index/test,就可以访问了.

4)我们也可以模拟IndexController.class.php增加控制器UserController.class.php

访问:http://localhost/case01/index.php/Home/User

5)创建一个新的管理模块

在项目的根目录,复制index.php 至admin.php,修改代码:

define('APP_PATH','./admin/');

访问:

http://localhost/case01/admin.php

http://localhost/case01/admin.php/Home

http://localhost/case01/admin.php/Home/Index

http://localhost/case01/admin.php/Home/Index/index

6)修改控制器\admin\Home\Controller\IndexController.class.php,增加:

public function test(){

     echo 'admin index controller test';

}

访问:http://localhost/case01/admin.php/Home/Index/test

查看更多关于ThinkPHP在eclipse使用 - Thinkphp的详细内容...

  阅读:123次