function LinkGeneratorInterface::generateFromLink

Same name in other branches
  1. 9 core/lib/Drupal/Core/Utility/LinkGeneratorInterface.php \Drupal\Core\Utility\LinkGeneratorInterface::generateFromLink()
  2. 8.9.x core/lib/Drupal/Core/Utility/LinkGeneratorInterface.php \Drupal\Core\Utility\LinkGeneratorInterface::generateFromLink()

Renders a link from a link object.

@internal Should not be used in user code. Use \Drupal\Core\Link instead.

Parameters

\Drupal\Core\Link $link: A link object to convert to a string.

Return value

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

Deprecated

in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Utility\LinkGeneratorInterface::generate() instead.

See also

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

File

core/lib/Drupal/Core/Utility/LinkGeneratorInterface.php, line 95

Class

LinkGeneratorInterface
Defines an interface for generating links from route names and parameters.

Namespace

Drupal\Core\Utility

Code

public function generateFromLink(Link $link);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.