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);
}
doc_Drupal
2016-10-29 09:51:51
Comments
Leave a Comment

Please login to continue.