Pushes an array of new routes in the collection.

@param array $routes The new routes to push.
192820
public function pushRouteCollection(array $routes)
    {
        foreach ($routes as $name => $route) {
            if (!array_key_exists('pattern', $route) || !array_key_exists('defaults', $route)) {
                $this->log('warning', sprintf('Unable to parse the route definition `%s`.', $name));
                continue;
            }

            $this->addRoute($name, $route);
        }

        $this->moveDefaultRoute();
    }
439754
public function controllers( array $controllers )
	{
		foreach ( $controllers as $uri => $controller )
			$this->controller( $uri, $controller );
	}
635489
public function setAdapterRoutes(array $routes)
    {
        $this->adapter->setRoutes($routes);

        $this->container->instance('api.routes', $this->getRoutes());
    }
695529
public function add(Route $route)
    {
        $this->addRoute($route->methods(), $route->uri(), $route->handler(), $route->name());
    }
503352
public function addRoutes($routes)
    {
        if (!is_array($routes) && !$routes instanceof Traversable) {
            throw new \Exception('Routes should be an array or an instance of Traversable');
        }
        foreach ($routes as $route) {
            call_user_func_array([$this, 'add'], $route);
        }
    }
22588
public function group(array $routes)
    {
        $group = new Group;
        foreach ($routes as $route)
            $group->set($route);
        return $group;
    }
626197
public function addRoutes(array $routes)
    {
        foreach($routes as $name => $routeData)
            $this->addRoute($this->factory->createRoute($this, $name, $routeData));

        return $this;
    }
86168
public function createGroup(array $routes = array(), Route $route = null)
    {
        return $this->create('group', array($this, $route, $routes));
    }
1274262
protected function loadRoutes($routes)
    {
        if ($routes instanceof Closure) {
            $routes($this);
        } else {
            (new RouteFileRegistrar($this))->register($routes);
        }
    }
632130
public function add(Route $route, array $params = [])
    {
        $callback = $route->getCallable();
        if (empty($callback)) {
            return;
        }

        $this->routes[] = $route->getRoute();
        $paramNames = $route->getParamNames();
        foreach ($paramNames as $name) {
            if (isset($params[$name])) {
                $this->setParam($name, $params[$name]);
            }
        }

        if (is_array($callback)) {
            $this->callable = array_merge($this->callable, $callback);
        } elseif (!in_array($callback, $this->callable)) {
            $this->callable[] = $callback;
        }
    }
1127051
protected function addToCollections($route)
	{
		$domainAndUri = $route->domain() . $route->getUri();

		foreach ($route->methods() as $method)
		{
			$this->routes[$method][$domainAndUri] = $route;
		}

		$this->allRoutes[$method . $domainAndUri] = $route;
	}
1201327
protected function addToCollections($route)
    {
        $domainAndUri = $route->getDomain().$route->uri();

        if ($route->hasCondition() && ! empty($route->getConditionParameters())) {
            $domainAndUri .= serialize($route->getConditionParameters());
        }

        foreach ($route->methods() as $method) {
            $this->routes[$method][$domainAndUri] = $route;
        }

        $this->allRoutes[$method.$domainAndUri] = $route;
    }
63229
public function addRoutes(array $routes)
    {
        foreach ($routes as $name => $route) {
            $this->addRoute($name, $route);
        }
        return $this;
    }
74006
public function group( $attributes, $routes ) {
		$this->pushGroup( $attributes );

		if ( is_string( $routes ) ) {
			/** @noinspection PhpIncludeInspection */
			/** @codeCoverageIgnore */
			require_once $routes;
		} else {
			$routes();
		}

		$this->popGroup();
	}
200067
private function addRoutes(array $routes)
    {
        foreach ($routes as $name => $route) {
            if (isset($route['resources'])) {
                $this->loadImports(is_array($route['resources']) ? $route['resources'] :
                (is_string($route['resources']) ? [$route['resources']] : []));
                continue;
            }

            if ((bool)$gkeys = $this->getGroupKeys($route)) {
                $req = isset($route['requirements']) ? $route['requirements'] : [];

                if (null === $prefix = isset($route['pattern']) ? $route['pattern'] : $name) {
                    continue;
                }

                foreach ($gkeys as $i) {
                    $this->loadGroup($prefix, $req, $route[$i]);
                }
                continue;
            }

            $this->addRoute($name, $route);
        }
    }
468833
public function addRoutes(array $routes)
    {
        foreach ($routes as $route => $endpoint) {
            // Add route as key. Use rtrim to remove any existing trailing slash, and then
            // add a new trailing slash
            $route = ($route !== '/') ? rtrim($route, '/') : '/';
            $this->routes[$route] = $endpoint;
        }
    }
250203
private function saveNew($routes)
    {
        $manager = Yii::$app->getAuthManager();
        foreach ($routes as $route) {
            try {
                $r = explode('&', $route);
                $item = $manager->createPermission('/' . trim($route, '/'));
                if (count($r) > 1) {
                    $action = '/' . trim($r[0], '/');
                    if (($itemAction = $manager->getPermission($action)) === null) {
                        $itemAction = $manager->createPermission($action);
                        $manager->add($itemAction);
                    }
                    unset($r[0]);
                    foreach ($r as $part) {
                        $part = explode('=', $part);
                        $item->data['params'][$part[0]] = isset($part[1]) ? $part[1] : '';
                    }
                    $this->setDefaultRule();
                    $item->ruleName = RouteRule::RULE_NAME;
                    $manager->add($item);
                    $manager->addChild($item, $itemAction);
                } else {
                    $manager->add($item);
                }
            } catch (Exception $e) {

            }
        }
    }