使用命令行创建项目模块
php think build --module home
生成的index,php中 没有继承Controller 类,会报错 需要手动添加
<?php
namespace app\home\controller;
use think\Controller;
class Index extends Controller
{
public function index()
{
$this->view->engine->layout(true);
return view('index');
}
}
创建控制器
php think make:controller home/Login --plain
创建model
php think make:model common/User