protected function TmgmtConfigRouteSubscriber::alterRoutes

File

sources/tmgmt_config/src/Routing/TmgmtConfigRouteSubscriber.php, line 17

Class

TmgmtConfigRouteSubscriber
Subscriber to alter entity translation routes.

Namespace

Drupal\tmgmt_config\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\\config_translation\\Controller\\ConfigTranslationController::itemPage') {
      $route
        ->setDefault('_controller', '\\Drupal\\tmgmt_config\\Controller\\ConfigTranslationControllerOverride::itemPage');
    }
  }
}