2019.3.14 think PHP

think PHP

生成目录结构

将build.php复制application/index/controller

return [
// 生成应用公共文件
'__file__' => ['common.php'],

// 定义demo模块的自动生成 (按照实际定义的文件名生成)
'demo' => [
'__file__' => ['common.php'],
'__dir__' => ['behavior', 'controller', 'model', 'view'],
'controller' => ['Index', 'Test', 'UserType'],
'model' => ['User', 'UserType'],
'view' => ['index/index'],
],

// 其他更多的模块定义
];

public/index.php底部添加下面的代码

//下面的代码,执行添加新模块
$build = include '../build.php';
//运行自动生成
Container::get('build')->run($build);

运行;

posted @ 2019-03-14 14:15  黄加蓝  阅读(127)  评论(0编辑  收藏  举报