thinkphp3.1模块分组的建立详细步骤

我的lamp环境用的是wamp,php版本是5.3.10。
根目录:E:\wamp\www\
1.将ThinkPHP核心包,放入App目录,放入后的目录:
E:\wamp\www\App\ThinkPHP

2.添加index.php,放入后的目录:
E:\wamp\www\App\index.php

3.在index.php里面加入代码:
define('APP_NAME', 'APP');
define('APP_PATH', './APP/');
define('APP_DEBUG', TRUE);
require './ThinkPHP/ThinkPHP.php';

4.访问项目地址E:\wamp\www\App,会在App目录下面自动创建系统文件:
![](http://img.blog.csdn.net/20151123184429081)

5.编辑/APP/Conf/config.php,放入下面的代码:
return array(
//'配置项'=>'配置值'
'APP_GROUP_LIST' => 'Index,Admin',
'DEFAULT_GROUP' => 'Index',
'APP_GROUP_MODE' => 1,
'APP_GROUP_PATH' => 'Modules',
);

6.创建 /APP/Modules/Index/Action/目录,在目录里面加入IndexAction.class.php文件,并写入代码:

class IndexAction extends Action {
public function index(){
    dump(111);
}
}

7.在modules下需要自己手动创建各个需要的目录,效果如图。
例如Action:
Modules\Admin\Action
Modules\Index\Action
8.访问地址是这样写的:
Index模块:
http://localhost/ThinkPHP_3.1.3_full-3/index.php/Index/index
Admin模块(因为已经指定为默认模块了,所以也可以直接访问该项目的目录,即可访问):
http://localhost/ThinkPHP_3.1.3_full-3/index.php/Admin/Index


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值