3 namespace Drupal\views\Plugin\views\display;
5 use Symfony\Component\Routing\RouteCollection;
8 * Defines an interface for displays that can collect routes.
10 * In addition to implementing the interface, specify 'uses_routes' in the
13 interface DisplayRouterInterface extends DisplayPluginInterface {
16 * Adds the route entry of a view to the collection.
18 * @param \Symfony\Component\Routing\RouteCollection $collection
19 * A collection of routes that should be registered for this resource.
21 public function collectRoutes(RouteCollection $collection);
24 * Alters a collection of routes and replaces definitions to the view.
26 * Most of the collections won't have the needed route, so by the return value
27 * the method can specify to break the search.
29 * @param \Symfony\Component\Routing\RouteCollection $collection
32 * Returns a list of "$view_id.$display_id" elements which got overridden.
34 public function alterRoutes(RouteCollection $collection);
37 * Generates a URL to this display.
39 * @return \Drupal\Core\Url
40 * A URL object for the display.
42 public function getUrlInfo();
45 * Returns the route name for the display.
47 * The default route name for a display is views.$view_id.$display_id. Some
48 * displays may override existing routes; in these cases, the route that is
49 * overridden is returned instead.
52 * The name of the route
54 * @see \Drupal\views\Plugin\views\display\DisplayRouterInterface::alterRoutes()
55 * @see \Drupal\views\Plugin\views\display\DisplayRouterInterface::getAlteredRouteNames()
57 public function getRouteName();
60 * Returns the list of routes overridden by Views.
63 * An array of overridden route names. The keys are in the form
64 * view_id.display_id and the values are the route names.
66 * @see \Drupal\views\Plugin\views\display\DisplayRouterInterface::alterRoutes()
68 public function getAlteredRouteNames();