public function Router::setContext

Sets the request context.

@api

Parameters

RequestContext $context The context:

Overrides RequestContextAwareInterface::setContext

File

drupal/core/vendor/symfony/routing/Symfony/Component/Routing/Router.php, line 182

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);
  }
}