getMatcher() public method

Gets the UrlMatcher instance associated with this Router.
public getMatcher ( ) : UrlMatcherInterface
return UrlMatcherInterface A UrlMatcherInterface instance
Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 public function getMatcher()
 {
     return new UrlMatcherDecorator(parent::getMatcher(), $this->getContext());
 }
 /**
  * {@inheritdoc}
  */
 public function warmUp($cacheDir)
 {
     $this->router->getMatcher();
     $this->router->getGenerator();
 }