RouteSubscriber.php in Opigno module 8
File
src/Routing/RouteSubscriber.php
View source
<?php
namespace Drupal\opigno_module\Routing;
use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;
class RouteSubscriber extends RouteSubscriberBase {
protected function alterRoutes(RouteCollection $collection) {
if ($route = $collection
->get('entity.opigno_module.collection')) {
$route
->setPath('/admin/structure/opigno-modules');
}
if ($route = $collection
->get('entity.opigno_activity.collection')) {
$route
->setPath('/admin/structure/opigno-activities');
}
if ($route = $collection
->get('entity.group.collection')) {
$route
->setPath('/admin/structure/groups');
}
if ($route = $collection
->get('private_message.private_message_page')) {
$route
->setDefault('_title', 'Discussion threads');
}
if ($route = $collection
->get('entity_browser.media_entity_browser_groups')) {
$route
->setRequirements([
'_custom_access' => '\\Drupal\\opigno_module\\Controller\\OpignoModuleController::accessEntityBrowserGroups',
]);
}
if ($route = $collection
->get('h5peditor.content_type_cache')) {
$route
->setDefaults(array(
'_controller' => '\\Drupal\\opigno_module\\Controller\\OpignoH5PEditorAJAXController::contentTypeCacheCallback',
));
}
}
}