interface PreloadableRouteProviderInterface implements RouteProviderInterface (View source)

Extends the router provider interface to pre-load routes.

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.

preLoadRoutes(string[] $names)

Pre-load routes by their names using the provided list of names.

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.

preLoadRoutes(string[] $names)

Pre-load routes by their names using the provided list of names.

This method exists in order to allow performance optimizations. It allows pre-loading serialized routes that may latter be retrieved using ::getRoutesByName()

Parameters

string[] $names

Array of route names to load.