You are here

class RouteSubscriber in Paranoia 8

Listens to dynamic route events.

Hierarchy

Expanded class hierarchy of RouteSubscriber

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

File

src/Routing/RouteSubscriber.php, line 11

Namespace

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

  /**
   * {@inheritdoc}
   */
  public function alterRoutes(RouteCollection $collection) {
    $hidden_routes = \Drupal::moduleHandler()
      ->invokeAll('paranoia_hide_routes');
    foreach ($hidden_routes as $key) {
      if ($route = $collection
        ->get($key)) {
        $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