- 配置项目根目录下的build.php文件该文件内容如下:
-
<
<?php // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- // | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Author: liu21st <liu21st@gmail.com> // +---------------------------------------------------------------------- return [ // 生成应用公共文件 '__file__' => ['common.php', 'config.php', 'database.php'], // 定义api模块的自动生成 (按照实际定义的文件名生成) 'api' => [ '__file__' => ['common.php','config.php','database.php'], // 生成的配置文件 '__dir__' => ['behavior', 'controller', 'model', 'view'], // 生成文件夹 'controller' => [], // 生成控制器 'model' => [], // 生成模型层 'view' => [], // 生成视图 ], // 其他更多的模块定义 ];
-
- 配置好上面的文件后在项目的根目录执行命令
-
php think build --config build.php ----> 用于生成模块
-
Tp5中配置多模块开发
最新推荐文章于 2021-03-24 08:36:36 发布