class RouteSubscriber in CMS Content Sync 8
Same name and namespace in other branches
- 2.1.x src/Routing/RouteSubscriber.php \Drupal\cms_content_sync\Routing\RouteSubscriber
- 2.0.x src/Routing/RouteSubscriber.php \Drupal\cms_content_sync\Routing\RouteSubscriber
Listens to the dynamic route events.
Hierarchy
- class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\cms_content_sync\Routing\RouteSubscriber
Expanded class hierarchy of RouteSubscriber
1 string reference to 'RouteSubscriber'
1 service uses RouteSubscriber
File
- src/
Routing/ RouteSubscriber.php, line 11
Namespace
Drupal\cms_content_sync\RoutingView source
class RouteSubscriber extends RouteSubscriberBase {
/**
* {@inheritdoc}
*/
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());
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RouteSubscriber:: |
protected | function |
Alters existing routes for a specific collection. Overrides RouteSubscriberBase:: |
|
RouteSubscriberBase:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | 5 |
RouteSubscriberBase:: |
public | function | Delegates the route altering to self::alterRoutes(). | 1 |