public RoutePreloader::onAlterRoutes(RouteBuildEvent $event)
Alters existing routes for a specific collection.
\Drupal\Core\Routing\RouteBuildEvent $event: The route build event.
public function onAlterRoutes(RouteBuildEvent $event) {
$collection = $event->getRouteCollection();
foreach ($collection->all() as $name => $route) {
if (strpos($route->getPath(), '/admin/') !== 0 && $route->getPath() != '/admin') {
$this->nonAdminRoutesOnRebuild[] = $name;
}
}
$this->nonAdminRoutesOnRebuild = array_unique($this->nonAdminRoutesOnRebuild);
}
© 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!Routing!RoutePreloader.php/function/RoutePreloader::onAlterRoutes/8.1.x