You are here

class RouteSubscriber in Varbase Core 8.7

Same name and namespace in other branches
  1. 8.8 modules/varbase_update_helper/src/Routing/RouteSubscriber.php \Drupal\varbase_update_helper\Routing\RouteSubscriber
  2. 8.6 modules/varbase_update_helper/src/Routing/RouteSubscriber.php \Drupal\varbase_update_helper\Routing\RouteSubscriber
  3. 9.0.x modules/varbase_update_helper/src/Routing/RouteSubscriber.php \Drupal\varbase_update_helper\Routing\RouteSubscriber

Listens to the dynamic route events.

Hierarchy

  • class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface

Expanded class hierarchy of RouteSubscriber

1 string reference to 'RouteSubscriber'
varbase_update_helper.services.yml in modules/varbase_update_helper/varbase_update_helper.services.yml
modules/varbase_update_helper/varbase_update_helper.services.yml
1 service uses RouteSubscriber
varbase_update_helper.route_subscriber in modules/varbase_update_helper/varbase_update_helper.services.yml
Drupal\varbase_update_helper\Routing\RouteSubscriber

File

modules/varbase_update_helper/src/Routing/RouteSubscriber.php, line 11

Namespace

Drupal\varbase_update_helper\Routing
View source
class RouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  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');
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RouteSubscriber::alterRoutes public function Alters existing routes for a specific collection. Overrides RouteSubscriberBase::alterRoutes
RouteSubscriberBase::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to. 5
RouteSubscriberBase::onAlterRoutes public function Delegates the route altering to self::alterRoutes(). 1