You are here

protected function RouteSubscriber::alterRoutes in Opigno messaging 3.x

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\opigno_messaging\Routing

Code

protected function alterRoutes(RouteCollection $collection) {
  if ($route = $collection
    ->get('private_message.private_message_page')) {
    $route
      ->setDefault('_title', 'Messages');
  }
  if ($route = $collection
    ->get('entity.private_message_thread.canonical')) {
    $route
      ->setDefault('_title', 'Messages');
  }
}