TmgmtContentRouteSubscriber.php in Translation Management Tool 8
File
sources/content/src/Routing/TmgmtContentRouteSubscriber.php
View source
<?php
namespace Drupal\tmgmt_content\Routing;
use Drupal\Core\Routing\RouteSubscriberBase;
use Drupal\Core\Routing\RoutingEvents;
use Symfony\Component\Routing\RouteCollection;
class TmgmtContentRouteSubscriber extends RouteSubscriberBase {
protected function alterRoutes(RouteCollection $collection) {
foreach ($collection as $route) {
if ($route
->getDefault('_controller') == '\\Drupal\\content_translation\\Controller\\ContentTranslationController::overview') {
$route
->setDefault('_controller', '\\Drupal\\tmgmt_content\\Controller\\ContentTranslationControllerOverride::overview');
}
}
}
public static function getSubscribedEvents() {
$events = parent::getSubscribedEvents();
$events[RoutingEvents::ALTER] = array(
'onAlterRoutes',
-211,
);
return $events;
}
}