protected function HeartbeatRouteSubscriber::alterRoutes in Heartbeat 8
Alters existing routes for a specific collection.
Parameters
\Symfony\Component\Routing\RouteCollection $collection: The route collection for adding routes.
Overrides RouteSubscriberBase::alterRoutes
File
- src/
Routing/ HeartbeatRouteSubscriber.php, line 24
Class
Namespace
Drupal\heartbeat\RoutingCode
protected function alterRoutes(RouteCollection $collection) {
if ($collection) {
if ($thisroute = $collection
->get('heartbeat.update_feed')) {
$path = $thisroute
->getPath();
}
}
if ($route = $collection
->get('heartbeat.user_edit')) {
if ($route !== null) {
$route
->setPath('/user/' . \Drupal::currentUser()
->id() . '/edit');
}
}
}