Pagekit\Debug\DataCollector\RoutesDataCollector::__construct PHP Method

__construct() public method

Constructor.
public __construct ( Pagekit\Routing\Router $router, Pagekit\Event\EventDispatcherInterface $events, string $cache, string $file = '%s.cache' )
$router Pagekit\Routing\Router
$events Pagekit\Event\EventDispatcherInterface
$cache string
$file string
    public function __construct(Router $router, EventDispatcherInterface $events, $cache, $file = '%s.cache')
    {
        $this->router = $router;
        $this->cache = $cache;
        $this->file = $file;
        $events->on('request', function ($event, $request) {
            $this->route = $request->attributes->get('_route');
        });
    }