public function ChainRouter::all

Sorts the routers and flattens them.

Return value

RouterInterface[]

5 calls to ChainRouter::all()
ChainRouter::doMatch in drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/ChainRouter.php
Loops through all routers and tries to match the passed request or url.
ChainRouter::generate in drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/ChainRouter.php
Loops through all registered routers and returns a router if one is found. It will always return the first route generated.
ChainRouter::getRouteCollection in drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/ChainRouter.php
Gets the RouteCollection instance associated with this Router.
ChainRouter::setContext in drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/ChainRouter.php
Sets the request context.
ChainRouter::warmUp in drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/ChainRouter.php
check for each contained router if it can warmup

File

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

Class

ChainRouter
ChainRouter

Namespace

Symfony\Cmf\Component\Routing

Code

public function all() {
  if (empty($this->sortedRouters)) {
    $this->sortedRouters = $this
      ->sortRouters();

    // setContext() is done here instead of in add() to avoid fatal errors when clearing and warming up caches
    // See https://github.com/symfony-cmf/Routing/pull/18
    $context = $this
      ->getContext();
    if (null !== $context) {
      foreach ($this->sortedRouters as $router) {
        if ($router instanceof RequestContextAwareInterface) {
          $router
            ->setContext($context);
        }
      }
    }
  }
  return $this->sortedRouters;
}