You are here

public function Router::setContext in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/routing/Router.php \Symfony\Component\Routing\Router::setContext()

Sets the request context.

Parameters

RequestContext $context The context:

Overrides RequestContextAwareInterface::setContext

File

vendor/symfony/routing/Router.php, line 199

Class

Router
The Router class is an example of the integration of all pieces of the routing system for easier use.

Namespace

Symfony\Component\Routing

Code

public function setContext(RequestContext $context) {
  $this->context = $context;
  if (null !== $this->matcher) {
    $this
      ->getMatcher()
      ->setContext($context);
  }
  if (null !== $this->generator) {
    $this
      ->getGenerator()
      ->setContext($context);
  }
}