You are here

protected function RouteSubscriber::addRoute in Organic groups 8

Helper method to add route to collection.

Parameters

\Symfony\Component\Routing\RouteCollection $collection: The collection route.

string $route_name: The route name.

string $path: The route path.

array $route_info: Array with the router definitions. Required keys are "defaults", "options", and "requirements".

1 call to RouteSubscriber::addRoute()
RouteSubscriber::createRoutesFromEventSubscribers in src/Routing/RouteSubscriber.php
Add all the OG admin items to the route collection.

File

src/Routing/RouteSubscriber.php, line 144

Class

RouteSubscriber
Route subscriber for OG related routes.

Namespace

Drupal\og\Routing

Code

protected function addRoute(RouteCollection $collection, $route_name, $path, array $route_info) {
  $route = new Route($path);
  $route
    ->addDefaults($route_info['defaults'])
    ->addRequirements($route_info['requirements'])
    ->addOptions($route_info['options']);
  $collection
    ->add($route_name, $route);
}