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