You are here

protected function LinkGeneratorTrait::l in Drupal 8

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 is removed from drupal:9.0.0. Use \Drupal\Core\Link::fromTextAndUrl() instead.

See also

https://www.drupal.org/node/2614344

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

File

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

Class

LinkGeneratorTrait
Wrapper methods for the Link Generator.

Namespace

Drupal\Core\Routing

Code

protected function l($text, Url $url) {
  @trigger_error(__NAMESPACE__ . "\\LinkGeneratorTrait::l() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \\Drupal\\Core\\Link::fromTextAndUrl() instead. See https://www.drupal.org/node/2614344", E_USER_DEPRECATED);
  return $this
    ->getLinkGenerator()
    ->generate($text, $url);
}