You are here

public function RouteCollection::addCollection in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/routing/RouteCollection.php \Symfony\Component\Routing\RouteCollection::addCollection()

Adds a route collection at the end of the current set by appending all routes of the added collection.

Parameters

RouteCollection $collection A RouteCollection instance:

1 method overrides RouteCollection::addCollection()
ChainRouteCollection::addCollection in vendor/symfony-cmf/routing/ChainRouteCollection.php
Adds a route collection at the end of the current set by appending all routes of the added collection.

File

vendor/symfony/routing/RouteCollection.php, line 122

Class

RouteCollection
A RouteCollection represents a set of Route instances.

Namespace

Symfony\Component\Routing

Code

public function addCollection(RouteCollection $collection) {

  // we need to remove all routes with the same names first because just replacing them
  // would not place the new route at the end of the merged array
  foreach ($collection
    ->all() as $name => $route) {
    unset($this->routes[$name]);
    $this->routes[$name] = $route;
  }
  $this->resources = array_merge($this->resources, $collection
    ->getResources());
}