function StaticRouteDiscoveryBase::onRouteBuild

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Routing/StaticRouteDiscoveryBase.php \Drupal\Core\Routing\StaticRouteDiscoveryBase::onRouteBuild()

Adds routes to the route builder.

Parameters

\Drupal\Core\Routing\RouteBuildEvent $event: The route build event.

File

core/lib/Drupal/Core/Routing/StaticRouteDiscoveryBase.php, line 92

Class

StaticRouteDiscoveryBase
Provides functionality for a class subscribed to RoutingEvents::STATIC.

Namespace

Drupal\Core\Routing

Code

public function onRouteBuild(RouteBuildEvent $event) : void {
  foreach ($this->collectRoutes() as $collection) {
    $event->getRouteCollection()
      ->addCollection($collection);
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.