常用命令

审核中 Thinkphp6 未结 已结 置顶 精帖
删除 置顶 取消置顶 加精 取消加精
66 0
yswl
yswl VIP3 2021-09-04 10:21:43
悬赏:60金币 编辑此贴

框架下载:

这里的 tp 目录名你可以任意更改,这个目录就是我们后面会经常提到的应用根目录。

composer create-project topthink/think tp


如果你之前已经安装过,那么切换到你的应用根目录下面,然后执行下面的命令进行更新:

composer update topthink/framework

更新操作会删除thinkphp目录重新下载安装新版本,但不会影响app目录,因此不要在核心框架目录添加任何应用代码和类库。


生成资源控制器:

php think make:controller User


模板引擎:

如果你需要使用think-template模板引擎,只需要安装think-view 模板引擎驱动。

composer require topthink/think-view


注解路由扩展:

composer require topthink/think-annotation


生成验证类:

php think make:validate User


多应用模式扩展:

composer require topthink/think-multi-app