Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. namespace DrupalcontentRouting;
  2.  
  3. use DrupalCoreRoutingRouteSubscriberBase;
  4. use SymfonyComponentRoutingRouteCollection;
  5.  
  6. /**
  7. * Listens to the dynamic route events.
  8. */
  9. class RouteSubscriber extends RouteSubscriberBase {
  10.  
  11. /**
  12. * Used to alter routes.
  13. */
  14. protected function alterRoutes(RouteCollection $collection) {
  15. if ($route = $collection->get('system.admin_content')) {
  16. $route->setDefaults(array(
  17. '_controller' => 'DrupalcontentControllerContentOverviewController::overview',
  18. ));
  19. }
  20. }
  21.  
  22. }
  23.  
  24. namespace DrupalcontentController;
  25.  
  26. use DrupalsystemControllerSystemController;
  27.  
  28. /**
  29. * Class ContentOverviewController.
  30. */
  31. class ContentOverviewController extends SystemController {
  32.  
  33. /**
  34. * Content Overview.
  35. */
  36. public function overview($link_id) {
  37.  
  38. $build = [
  39. '#markup' => $this->t('Hello World!'),
  40. ];
  41. return $build;
  42. }
  43.  
  44. }
  45.  
  46. namespace DrupalcontentRouting
  47.  
  48. namespace DrupalmcontentRouting
  49.  
  50. services:
  51. content.route_subscriber:
  52. class: DrupalcontentRoutingRouteSubscriber
  53. tags:
  54. - { name: event_subscriber }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement