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 151

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;
  $this
    ->getMatcher()
    ->setContext($context);
  $this
    ->getGenerator()
    ->setContext($context);
}