TP6中命令行操作
1、啟動內置服務器
php think run //指定IP和端口 php think run -H tp.com -p 80
2、查看當前版本
php think version
3、快速生成應用
php think build demo
4、快速生成控制器
//生成index應用的Blog控制器 php think make:controller index@Blog //如果單應用生成控制器 php think make:controller Blog //生成空控制器 php think make:controller --plain
5、快速生成模型
php think make:model index@blog //如果單應用無需傳入應用名 php think make Blog //生成帶后綴的類庫 php think make:controller index@BlogController php think make:model BlogModel
6、快速生成中間件
php think make:middleware Auth //快速生成驗證器 php think make:validate index@user
7、清除緩存
//清除應用緩存文件 php think clear //如果不需要保留空目錄 php think clear --dir //清除日志目錄 php think clear --log