You are here

class RouteSubscriber in CMS Content Sync 8

Same name and namespace in other branches
  1. 2.1.x src/Routing/RouteSubscriber.php \Drupal\cms_content_sync\Routing\RouteSubscriber
  2. 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

Expanded class hierarchy of RouteSubscriber

1 string reference to 'RouteSubscriber'
cms_content_sync.services.yml in ./cms_content_sync.services.yml
cms_content_sync.services.yml
1 service uses RouteSubscriber
cms_content_sync.route_subscriber in ./cms_content_sync.services.yml
Drupal\cms_content_sync\Routing\RouteSubscriber

File

src/Routing/RouteSubscriber.php, line 11

Namespace

Drupal\cms_content_sync\Routing
View 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

Namesort descending Modifiers Type Description Overrides
RouteSubscriber::alterRoutes protected function Alters existing routes for a specific collection. Overrides RouteSubscriberBase::alterRoutes
RouteSubscriberBase::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to. 5
RouteSubscriberBase::onAlterRoutes public function Delegates the route altering to self::alterRoutes(). 1