我的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
thinkphp3.1模块分组的建立详细步骤
最新推荐文章于 2022-12-04 20:51:30 发布