You are here

class RouteSubscriber in CMS Content Sync 2.0.x

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

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 7
RouteSubscriberBase::onAlterRoutes public function Delegates the route altering to self::alterRoutes(). 1