You are here

public function RouteSubscriber::alterRoutes in Varbase Core 9.0.x

Same name and namespace in other branches
  1. 8.8 modules/varbase_update_helper/src/Routing/RouteSubscriber.php \Drupal\varbase_update_helper\Routing\RouteSubscriber::alterRoutes()
  2. 8.6 modules/varbase_update_helper/src/Routing/RouteSubscriber.php \Drupal\varbase_update_helper\Routing\RouteSubscriber::alterRoutes()
  3. 8.7 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\Routing

Code

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');
  }
}