UrlGeneratorTrait

Wrapper methods for the Url Generator.

This utility trait should only be used in application-level code, such as classes that would implement ContainerInjectionInterface. Services registered in the Container should not use this trait but inject the appropriate service directly for easier testing.

Hierarchy

Deprecated

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

File

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

Namespace

Drupal\Core\Routing

Members

Name Modifiers Type Description
UrlGeneratorTrait::$urlGenerator protected property The url generator.
UrlGeneratorTrait::getUrlGenerator protected function Returns the URL generator service.
UrlGeneratorTrait::redirect protected function Returns a redirect response object for the specified route.
UrlGeneratorTrait::setUrlGenerator public function Sets the URL generator service.
UrlGeneratorTrait::url Deprecated protected function Generates a URL or path for a specific route based on the given parameters.
doc_Drupal
2016-10-29 09:51:50
Comments
Leave a Comment

Please login to continue.