LinkGeneratorTrait::l

protected LinkGeneratorTrait::l($text, Url $url)

Renders a link to a route given a route name and its parameters.

For details on the arguments, usage, and possible exceptions see \Drupal\Core\Utility\LinkGeneratorInterface::generate().

Return value

\Drupal\Core\GeneratedLink A GeneratedLink object containing a link to the given route and parameters and bubbleable metadata.

Deprecated

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

See also

\Drupal\Core\Utility\LinkGeneratorInterface::generate()

File

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

Class

LinkGeneratorTrait
Wrapper methods for the Link Generator.

Namespace

Drupal\Core\Routing

Code

protected function l($text, Url $url) {
  return $this->getLinkGenerator()->generate($text, $url);
}
doc_Drupal
2016-10-29 09:23:19
Comments
Leave a Comment

Please login to continue.