interface CacheableRouteProviderInterface implements RouteProviderInterface (View source)

Extends the router provider interface to provide caching support.

Methods

RouteCollection
getRoutesByPattern(string $pattern)

Get all routes which match a certain pattern.

Route[]
getAllRoutes()

Returns all the routes on the system.

reset()

Resets the route provider object.

addExtraCacheKeyPart(string $cache_key_provider, string $cache_key_part)

Adds a cache key part to be used in the cache ID of the route collection.

Details

RouteCollection getRoutesByPattern(string $pattern)

Get all routes which match a certain pattern.

Parameters

string $pattern

The route pattern to search for (contains } as placeholders).

Return Value

RouteCollection

Returns a route collection of matching routes. The collection may be empty and will be sorted from highest to lowest fit (match of path parts) and then in ascending order by route name for routes with the same fit.

Route[] getAllRoutes()

Returns all the routes on the system.

Usage of this method is discouraged for performance reasons. If possible, use RouteProviderInterface::getRoutesByNames() or RouteProviderInterface::getRoutesByPattern() instead.

Return Value

Route[]

An iterator of routes keyed by route name.

reset()

Resets the route provider object.

addExtraCacheKeyPart(string $cache_key_provider, string $cache_key_part)

Adds a cache key part to be used in the cache ID of the route collection.

Parameters

string $cache_key_provider

The provider of the cache key part.

string $cache_key_part

A string to be used as a cache key part.