You are here

public static function Url::fromRouteMatch in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Url.php \Drupal\Core\Url::fromRouteMatch()

Creates a new URL object from a route match.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: The route match.

Return value

$this

5 calls to Url::fromRouteMatch()
batch_process in core/includes/form.inc
Processes the batch.
PathBasedBreadcrumbBuilder::build in core/modules/system/src/PathBasedBreadcrumbBuilder.php
Builds the breadcrumb.
PathMatcher::isFrontPage in core/lib/Drupal/Core/Path/PathMatcher.php
Checks if the current page is the front page.
UrlTest::testFromRouteMatch in core/tests/Drupal/Tests/Core/UrlTest.php
Tests the fromRouteMatch() method.
ViewUI::getStandardButtons in core/modules/views_ui/src/ViewUI.php
Provide a standard set of Apply/Cancel/OK buttons for the forms. Also provide a hidden op operator because the forms plugin doesn't seem to properly provide which button was clicked.

File

core/lib/Drupal/Core/Url.php, line 183
Contains \Drupal\Core\Url.

Class

Url
Defines an object that holds information about a URL.

Namespace

Drupal\Core

Code

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');
  }
}