protected function TmgmtContentRouteSubscriber::alterRoutes

File

sources/content/src/Routing/TmgmtContentRouteSubscriber.php, line 17

Class

TmgmtContentRouteSubscriber
Subscriber to alter entity translation routes.

Namespace

Drupal\tmgmt_content\Routing

Code

protected function alterRoutes(RouteCollection $collection) {

  // Look for routes that use  ContentTranslationController and change it
  // to our subclass.
  foreach ($collection as $route) {
    if ($route
      ->getDefault('_controller') == '\\Drupal\\content_translation\\Controller\\ContentTranslationController::overview') {
      $route
        ->setDefault('_controller', '\\Drupal\\tmgmt_content\\Controller\\ContentTranslationControllerOverride::overview');
    }
  }
}