class RouteSubscriber in Default Content 8
Subscriber for Devel routes.
Hierarchy
- class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\defaultcontent\Routing\RouteSubscriber
Expanded class hierarchy of RouteSubscriber
File
- src/
Routing/ RouteSubscriber.php, line 19 - Contains \Drupal\defaultcontent\Routing\RouteSubscriber.
Namespace
Drupal\defaultcontent\RoutingView source
class RouteSubscriber extends RouteSubscriberBase {
/**
* {@inheritdoc}
*/
protected function alterRoutes(RouteCollection $collection) {
$route = new Route('node/{node}/convert', [
'_controller' => '\\Drupal\\defaultcontent\\Export::export',
'_title_callback' => '\\Drupal\\defaultcontent\\Export::title',
], [
'_permission' => 'access devel information',
], [
'_admin_route' => TRUE,
]);
$collection
->add("entity.node.convert", $route);
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events = parent::getSubscribedEvents();
$events[RoutingEvents::ALTER] = 'onAlterRoutes';
return $events;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RouteSubscriber:: |
protected | function |
Alters existing routes for a specific collection. Overrides RouteSubscriberBase:: |
|
RouteSubscriber:: |
public static | function |
Returns an array of event names this subscriber wants to listen to. Overrides RouteSubscriberBase:: |
|
RouteSubscriberBase:: |
public | function | Delegates the route altering to self::alterRoutes(). | 1 |