trait LinkGeneratorTrait

Wrapper methods for the Link 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\Link instead.

File

core/lib/Drupal/Core/Routing/LinkGeneratorTrait.php, line 20

Namespace

Drupal\Core\Routing

Members

Name Modifiers Type Description
LinkGeneratorTrait::$linkGenerator protected property The link generator.
LinkGeneratorTrait::getLinkGenerator protected function Returns the link generator.
LinkGeneratorTrait::l Deprecated protected function Renders a link to a route given a route name and its parameters.
LinkGeneratorTrait::setLinkGenerator public function Sets the link generator service.

© 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!LinkGeneratorTrait.php/trait/LinkGeneratorTrait/8.1.x