class CourseRouteSubscriber in Course 3.x
Listens to the dynamic route events.
Hierarchy
- class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\course\EventSubscriber\CourseRouteSubscriber
Expanded class hierarchy of CourseRouteSubscriber
1 string reference to 'CourseRouteSubscriber'
1 service uses CourseRouteSubscriber
File
- src/
EventSubscriber/ CourseRouteSubscriber.php, line 11
Namespace
Drupal\course\EventSubscriberView source
class CourseRouteSubscriber extends RouteSubscriberBase {
/**
* Mark some views-provided routes as admin routes.
*
* {@inheritdoc}
*/
protected function alterRoutes(RouteCollection $collection) {
if ($route = $collection
->get('view.course_enrollments.course')) {
$route
->setOption('_admin_route', 'TRUE');
}
if ($route = $collection
->get('view.course_enroll.course')) {
$route
->setOption('_admin_route', 'TRUE');
}
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CourseRouteSubscriber:: |
protected | function |
Mark some views-provided routes as admin routes. Overrides RouteSubscriberBase:: |
|
RouteSubscriberBase:: |
public static | function | 7 | |
RouteSubscriberBase:: |
public | function | Delegates the route altering to self::alterRoutes(). | 1 |