slimshadyy 2016-07-22 15:31 采纳率: 0%
浏览 1057

关于laravel源码的一处疑惑

源码在make Kernel类时 是通过反射的方式去实例化,在调用构造函数时 :
public function __construct(Application $app, Router $router)
{
$this->app = $app;
$this->router = $router;
foreach ($this->middlewareGroups as $key => $middleware) {
$router->middlewareGroup($key, $middleware);
}

    foreach ($this->routeMiddleware as $key => $middleware) {
        $router->middleware($key, $middleware);
    }
}

为什么$this->middlewareGroups已经有内容了 是在何时赋值的?
  • 写回答

0条回答 默认 最新

    报告相同问题?