protected function RouteSubscriber::alterRoutes in CMS Content Sync 2.1.x
Same name and namespace in other branches
- 8 src/Routing/RouteSubscriber.php \Drupal\cms_content_sync\Routing\RouteSubscriber::alterRoutes()
- 2.0.x src/Routing/RouteSubscriber.php \Drupal\cms_content_sync\Routing\RouteSubscriber::alterRoutes()
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/ RouteSubscriber.php, line 16
Class
- RouteSubscriber
- Listens to the dynamic route events.
Namespace
Drupal\cms_content_sync\RoutingCode
protected function alterRoutes(RouteCollection $collection) {
// Change page title based on whether the subscriber is using the cloud or self-hosted version.
if ($route = $collection
->get('entity.cms_content_sync.content')) {
$route
->setDefault('_title', _cms_content_sync_get_repository_name()
->getUntranslatedString());
}
}