public static Url::fromRouteMatch(RouteMatchInterface $route_match)
Creates a new URL object from a route match.
\Drupal\Core\Routing\RouteMatchInterface $route_match: The route match.
$this
public static function fromRouteMatch(RouteMatchInterface $route_match) { if ($route_match->getRouteObject()) { return new static($route_match->getRouteName(), $route_match->getRawParameters()->all()); } else { throw new \InvalidArgumentException('Route required'); } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Url.php/function/Url::fromRouteMatch/8.1.x