You are here

class RouteSubscriber in Drupal 10

Same name in this branch
  1. 10 core/modules/views/src/EventSubscriber/RouteSubscriber.php \Drupal\views\EventSubscriber\RouteSubscriber
  2. 10 core/modules/node/src/Routing/RouteSubscriber.php \Drupal\node\Routing\RouteSubscriber
  3. 10 core/modules/media_library/src/Routing/RouteSubscriber.php \Drupal\media_library\Routing\RouteSubscriber
  4. 10 core/modules/config_translation/src/Routing/RouteSubscriber.php \Drupal\config_translation\Routing\RouteSubscriber
  5. 10 core/modules/field_ui/src/Routing/RouteSubscriber.php \Drupal\field_ui\Routing\RouteSubscriber
  6. 10 core/modules/media/tests/modules/media_test_embed/src/Routing/RouteSubscriber.php \Drupal\media_test_embed\Routing\RouteSubscriber
Same name and namespace in other branches
  1. 9 core/modules/media/tests/modules/media_test_embed/src/Routing/RouteSubscriber.php \Drupal\media_test_embed\Routing\RouteSubscriber

Listens to the dynamic route events.

Hierarchy

  • class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface

Expanded class hierarchy of RouteSubscriber

1 string reference to 'RouteSubscriber'
media_test_embed.services.yml in core/modules/media/tests/modules/media_test_embed/media_test_embed.services.yml
core/modules/media/tests/modules/media_test_embed/media_test_embed.services.yml
1 service uses RouteSubscriber
media_test_embed.route_subscriber in core/modules/media/tests/modules/media_test_embed/media_test_embed.services.yml
Drupal\media_test_embed\Routing\RouteSubscriber

File

core/modules/media/tests/modules/media_test_embed/src/Routing/RouteSubscriber.php, line 11

Namespace

Drupal\media_test_embed\Routing
View source
class RouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  public function alterRoutes(RouteCollection $collection) {
    if ($route = $collection
      ->get('media.filter.preview')) {
      $route
        ->setDefault('_controller', '\\Drupal\\media_test_embed\\Controller\\TestMediaFilterController::preview');
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RouteSubscriber::alterRoutes public function Alters existing routes for a specific collection. Overrides RouteSubscriberBase::alterRoutes
RouteSubscriberBase::getSubscribedEvents public static function 4
RouteSubscriberBase::onAlterRoutes public function Delegates the route altering to self::alterRoutes().