class ReplicationConfigRouteSubscriber in Workspace 8
ReplicationConfigRouteSubscriber class.
Hierarchy
- class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\workspace\EventSubscriber\ReplicationConfigRouteSubscriber
Expanded class hierarchy of ReplicationConfigRouteSubscriber
1 string reference to 'ReplicationConfigRouteSubscriber'
1 service uses ReplicationConfigRouteSubscriber
File
- src/
EventSubscriber/ ReplicationConfigRouteSubscriber.php, line 13
Namespace
Drupal\workspace\EventSubscriberView source
class ReplicationConfigRouteSubscriber extends RouteSubscriberBase {
/**
* Alters the replication config route.
*
* @param \Symfony\Component\Routing\RouteCollection $collection
*/
protected function alterRoutes(RouteCollection $collection) {
if ($route = $collection
->get('replication.settings_form')) {
$route
->setDefault('_controller', ReplicationConfigController::class . '::getForms');
}
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events = parent::getSubscribedEvents();
$events[RoutingEvents::ALTER] = [
'onAlterRoutes',
100,
];
return $events;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ReplicationConfigRouteSubscriber:: |
protected | function |
Alters the replication config route. Overrides RouteSubscriberBase:: |
|
ReplicationConfigRouteSubscriber:: |
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 |