1. 生成控制器
// 默認(rèn)生成資源控制器,有七個方法資源操作方法
// index、create、save、read、edit、update、delete
php think make:controller Blog
// 創(chuàng)建多級控制器
php think make:controller user/Blog
// 創(chuàng)建index應(yīng)用下的Blog控制器
php think make:controller index@Blog
// 創(chuàng)建多級控制器
php think make:controller index@user/Profile
// 如果僅僅生成空的控制器則可以加上參數(shù) --plain
php think make:controller User --plain
// 如果只是用于接口開發(fā),可以使用參數(shù) --api
// index、save、read、update、delete
// 默認(rèn)提供5個操作方法,和資源控制器相比少了 create 和 edit 方法
php think make:controller User --api
2. 生成模型
php think make:model Blog
php think make:model index@Blog
php think make:model index@user/Profile
3. 生成驗證器
php think make:validate User
php think make:validate admin@User
php think make:validate admin@user/Address
4. 生成中間件
注意:命令行不支持直接在應(yīng)用下創(chuàng)建中間件
php think make:middleware Login
php think make:middleware user/Login