public PathRootsSubscriber::onRouteAlter(RouteBuildEvent $event)
Collects all path roots.
\Drupal\Core\Routing\RouteBuildEvent $event: The route build event.
public function onRouteAlter(RouteBuildEvent $event) { $collection = $event->getRouteCollection(); foreach ($collection->all() as $route) { $bits = explode('/', ltrim($route->getPath(), '/')); $this->pathRoots[$bits[0]] = $bits[0]; } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!EventSubscriber!PathRootsSubscriber.php/function/PathRootsSubscriber::onRouteAlter/8.1.x