protected function UrlGeneratorTrait::url

protected UrlGeneratorTrait::url($route_name, $route_parameters = array(), $options = array())

Generates a URL or path for a specific route based on the given parameters.

For details on the arguments, usage, and possible exceptions see \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute().

Return value

string The generated URL for the given route.

Deprecated

in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Url instead.

See also

\Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute()

File

core/lib/Drupal/Core/Routing/UrlGeneratorTrait.php, line 41

Class

UrlGeneratorTrait
Wrapper methods for the Url Generator.

Namespace

Drupal\Core\Routing

Code

protected function url($route_name, $route_parameters = array(), $options = array()) {
  return $this->getUrlGenerator()->generateFromRoute($route_name, $route_parameters, $options);
}

© 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!Routing!UrlGeneratorTrait.php/function/UrlGeneratorTrait::url/8.1.x