Gets the UrlMatcher instance associated with this Router.
public getMatcher ( ) : UrlMatcherInterface | ||
Résultat | UrlMatcherInterface | A UrlMatcherInterface instance |
public function loadRoutes($path, $options = array()) { $filelocator = new FileLocator($path); $routeloader = new YamlFileLoader($filelocator); $router = new Router($routeloader, $path, $options); $matcher = $router->getMatcher(); $routeCollection = $router->getRouteCollection(); $context = $router->getContext(); $this->dispatcher->addSubscriber(new HttpKernel\EventListener\RouterListener($matcher)); $this->shared['url.generator'] = new UrlGenerator($routeCollection, $context); $this->router = $router; return $router->getRouteCollection(); }
public function getMatcher() { return new UrlMatcherDecorator(parent::getMatcher(), $this->getContext()); }
/** * {@inheritdoc} */ public function warmUp($cacheDir) { $this->router->getMatcher(); $this->router->getGenerator(); }