ThinkPHP6在控制器方法中调用执行命令行
2022-11-24 11:10:29
168
{{single.collect_count}}

CLI模式

在CLI模式下调用的格式,如生成模型:php think make:model Hello

控制器

<?phpnamespace app\controller;class Index{public function index(){return \think\facade\Console::call('make:model',['Hello'])->fetch();}}

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}