class RouteSubscriber in Drupal 9
Same name in this branch
- 9 core/modules/views/src/EventSubscriber/RouteSubscriber.php \Drupal\views\EventSubscriber\RouteSubscriber
- 9 core/modules/node/src/Routing/RouteSubscriber.php \Drupal\node\Routing\RouteSubscriber
- 9 core/modules/media_library/src/Routing/RouteSubscriber.php \Drupal\media_library\Routing\RouteSubscriber
- 9 core/modules/config_translation/src/Routing/RouteSubscriber.php \Drupal\config_translation\Routing\RouteSubscriber
- 9 core/modules/field_ui/src/Routing/RouteSubscriber.php \Drupal\field_ui\Routing\RouteSubscriber
- 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
- class \Drupal\media_test_embed\Routing\RouteSubscriber
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\RoutingView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RouteSubscriber:: |
public | function |
Alters existing routes for a specific collection. Overrides RouteSubscriberBase:: |
|
RouteSubscriberBase:: |
public static | function | 7 | |
RouteSubscriberBase:: |
public | function | Delegates the route altering to self::alterRoutes(). | 1 |