RouteSubscriber
class RouteSubscriber extends RouteSubscriberBase (View source)
Builds up the routes of all views.
The general idea is to execute first all alter hooks to determine which routes are overridden by views. This information is used to determine which views have to be added by views in the dynamic event.
Properties
| protected array | $viewsDisplayPairs | Stores a list of view,display IDs which haven't be used in the alter event. |
|
| protected EntityStorageInterface | $viewStorage | The view storage. |
|
| protected StateInterface | $state | The state key value store. |
|
| protected array | $viewRouteNames | Stores an array of route names keyed by view_id.display_id. |
Methods
Alters existing routes for a specific collection.
{@inheritdoc}
Constructs a \Drupal\views\EventSubscriber\RouteSubscriber instance.
Resets the internal state of the route subscriber.
Gets all the views and display IDs using a route.
Returns a set of route objects.
Stores the new route names after they have been rebuilt.
Returns all views/display combinations with routes.
Details
protected
alterRoutes(RouteCollection $collection)
Alters existing routes for a specific collection.
static
getSubscribedEvents()
{@inheritdoc}
onAlterRoutes(RouteBuildEvent $event)
Delegates the route altering to self::alterRoutes().
__construct(EntityTypeManagerInterface $entity_type_manager, StateInterface $state)
Constructs a \Drupal\views\EventSubscriber\RouteSubscriber instance.
reset()
Resets the internal state of the route subscriber.
protected
getViewsDisplayIDsWithRoute()
Gets all the views and display IDs using a route.
RouteCollection
routes()
Returns a set of route objects.
routeRebuildFinished()
Stores the new route names after they have been rebuilt.
Callback for the RoutingEvents::FINISHED event.
protected
getApplicableViews()
Returns all views/display combinations with routes.