THINKPHP6 实现中间件
2022-11-24 11:10:29
149
{{single.collect_count}}
/** * 执行应用程序 * @param Request $request * @return mixed */protected function runWithRequest(Request $request){$this->initialize();// 加载全局中间件$this->loadMiddleware();// 设置开启事件机制$this->app->event->withEvent($this->app->config->get('app.with_event', true));// 监听HttpRun$this->app->event->trigger(HttpRun::class); //实例化管道类同时会将中间件类转化为闭包推入队列中return $this->app->middleware->pipeline()->send($request)->then(function ($request) {return $this->dispatchToRoute($request);});}

 

回帖
全部回帖({{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 ? '加载中...' : '查看更多评论'}}