Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace DrupalcontentRouting;
- use DrupalCoreRoutingRouteSubscriberBase;
- use SymfonyComponentRoutingRouteCollection;
- /**
- * Listens to the dynamic route events.
- */
- class RouteSubscriber extends RouteSubscriberBase {
- /**
- * Used to alter routes.
- */
- protected function alterRoutes(RouteCollection $collection) {
- if ($route = $collection->get('system.admin_content')) {
- $route->setDefaults(array(
- '_controller' => 'DrupalcontentControllerContentOverviewController::overview',
- ));
- }
- }
- }
- namespace DrupalcontentController;
- use DrupalsystemControllerSystemController;
- /**
- * Class ContentOverviewController.
- */
- class ContentOverviewController extends SystemController {
- /**
- * Content Overview.
- */
- public function overview($link_id) {
- $build = [
- '#markup' => $this->t('Hello World!'),
- ];
- return $build;
- }
- }
- namespace DrupalcontentRouting
- namespace DrupalmcontentRouting
- services:
- content.route_subscriber:
- class: DrupalcontentRoutingRouteSubscriber
- tags:
- - { name: event_subscriber }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement