You are here

public function ChainRouter::setContext in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony-cmf/routing/ChainRouter.php \Symfony\Cmf\Component\Routing\ChainRouter::setContext()

Sets the request context.

Parameters

RequestContext $context The context:

Overrides RequestContextAwareInterface::setContext

File

vendor/symfony-cmf/routing/ChainRouter.php, line 270

Class

ChainRouter
The ChainRouter allows to combine several routers to try in a defined order.

Namespace

Symfony\Cmf\Component\Routing

Code

public function setContext(RequestContext $context) {
  foreach ($this
    ->all() as $router) {
    if ($router instanceof RequestContextAwareInterface) {
      $router
        ->setContext($context);
    }
  }
  $this->context = $context;
}