public function DynamicRouter::__construct

Parameters

RequestContext $context:

RequestMatcherInterface|UrlMatcherInterface $matcher:

UrlGeneratorInterface $generator:

string $uriFilterRegexp:

File

drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/DynamicRouter.php, line 68

Class

DynamicRouter
A flexible router accepting matcher and generator through injection and using the RouteEnhancer concept to generate additional data on the routes.

Namespace

Symfony\Cmf\Component\Routing

Code

public function __construct(RequestContext $context, $matcher, UrlGeneratorInterface $generator, $uriFilterRegexp = '') {
  $this->context = $context;
  if (!$matcher instanceof RequestMatcherInterface && !$matcher instanceof UrlMatcherInterface) {
    throw new \InvalidArgumentException('Invalid $matcher');
  }
  $this->matcher = $matcher;
  $this->generator = $generator;
  $this->uriFilterRegexp = $uriFilterRegexp;
  $this->generator
    ->setContext($context);
}