public function RouteSubscriber::alterRoutes in Varbase Core 8.8
Same name and namespace in other branches
- 8.6 modules/varbase_update_helper/src/Routing/RouteSubscriber.php \Drupal\varbase_update_helper\Routing\RouteSubscriber::alterRoutes()
- 8.7 modules/varbase_update_helper/src/Routing/RouteSubscriber.php \Drupal\varbase_update_helper\Routing\RouteSubscriber::alterRoutes()
- 9.0.x modules/varbase_update_helper/src/Routing/RouteSubscriber.php \Drupal\varbase_update_helper\Routing\RouteSubscriber::alterRoutes()
Alters existing routes for a specific collection.
Parameters
\Symfony\Component\Routing\RouteCollection $collection: The route collection for adding routes.
Overrides RouteSubscriberBase::alterRoutes
File
- modules/
varbase_update_helper/ src/ Routing/ RouteSubscriber.php, line 16
Class
- RouteSubscriber
- Listens to the dynamic route events.
Namespace
Drupal\varbase_update_helper\RoutingCode
public function alterRoutes(RouteCollection $collection) {
if ($route = $collection
->get('checklistapi.checklists.update_helper_checklist')) {
$route
->setDefault('_title', 'Varbase update instructions');
}
// Always deny access to '/admin/config/development/update-helper/clear'.
if ($route = $collection
->get('checklistapi.checklists.update_helper_checklist.clear')) {
$route
->setRequirement('_access', 'FALSE');
}
}