public function RouteCollection::remove

Removes a route or an array of routes by name from all connected collections (this instance and all parents and children).

Parameters

string|array $name The route name or an array of route names:

2 calls to RouteCollection::remove()
RouteCollection::add in drupal/core/vendor/symfony/routing/Symfony/Component/Routing/RouteCollection.php
Adds a route.
RouteCollection::addCollection in drupal/core/vendor/symfony/routing/Symfony/Component/Routing/RouteCollection.php
Adds a route collection to the current set of routes (at the end of the current set).

File

drupal/core/vendor/symfony/routing/Symfony/Component/Routing/RouteCollection.php, line 174

Class

RouteCollection
A RouteCollection represents a set of Route instances as a tree structure.

Namespace

Symfony\Component\Routing

Code

public function remove($name) {
  $root = $this
    ->getRoot();
  foreach ((array) $name as $n) {
    $root
      ->removeRecursively($n);
  }
}