3 namespace Drupal\Core\Routing;
6 * Provides an interface for classes representing the result of routing.
8 * Routing is the process of selecting the best matching candidate from a
9 * collection of routes for an incoming request. The relevant properties of a
10 * request include the path as well as a list of raw parameter values derived
11 * from the URL. If an appropriate route is found, raw parameter values will be
12 * upcast automatically if possible.
14 * The route match object contains useful information about the selected route
15 * as well as the raw and upcast parameters derived from the incoming
20 interface RouteMatchInterface {
23 * Returns the route name.
26 * The route name. NULL if no route is matched.
28 public function getRouteName();
31 * Returns the route object.
33 * @return \Symfony\Component\Routing\Route|null
34 * The route object. NULL if no route is matched.
36 public function getRouteObject();
39 * Returns the processed value of a named route parameter.
41 * Raw URL parameters are processed by the parameter conversion system, which
42 * does operations such as converting entity ID parameters to fully-loaded
43 * entities. For example, the path node/12345 would have a raw node ID
44 * parameter value of 12345, while the processed parameter value would be the
45 * corresponding loaded node object.
47 * @param string $parameter_name
51 * The parameter value. NULL if the route doesn't define the parameter or
52 * if the parameter value can't be determined from the request.
54 * @see \Drupal\Core\Routing\RouteMatchInterface::getRawParameter()
56 public function getParameter($parameter_name);
59 * Returns the bag of all processed route parameters.
61 * Raw URL parameters are processed by the parameter conversion system, which
62 * does operations such as converting entity ID parameters to fully-loaded
63 * entities. For example, the path node/12345 would have a raw node ID
64 * parameter value of 12345, while the processed parameter value would be the
65 * corresponding loaded node object.
67 * @return \Symfony\Component\HttpFoundation\ParameterBag
70 * @see \Drupal\Core\Routing\RouteMatchInterface::getRawParameters()
72 public function getParameters();
75 * Returns the raw value of a named route parameter.
77 * @param string $parameter_name
81 * The raw (non-upcast) parameter value. NULL if the route doesn't define
82 * the parameter or if the raw parameter value can't be determined from the
85 * @see \Drupal\Core\Routing\RouteMatchInterface::getParameter()
87 public function getRawParameter($parameter_name);
90 * Returns the bag of all raw route parameters.
92 * @return \Symfony\Component\HttpFoundation\ParameterBag
95 * @see \Drupal\Core\Routing\RouteMatchInterface::getParameters()
97 public function getRawParameters();