You are here

public function LinkGenerator::generateFromLink in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Utility/LinkGenerator.php \Drupal\Core\Utility\LinkGenerator::generateFromLink()
  2. 9 core/lib/Drupal/Core/Utility/LinkGenerator.php \Drupal\Core\Utility\LinkGenerator::generateFromLink()

File

core/lib/Drupal/Core/Utility/LinkGenerator.php, line 63

Class

LinkGenerator
Provides a class which generates a link with route names and parameters.

Namespace

Drupal\Core\Utility

Code

public function generateFromLink(Link $link) {
  return $this
    ->generate($link
    ->getText(), $link
    ->getUrl());
}