function LinkGenerator::generateFromLink

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

Overrides LinkGeneratorInterface::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());
}

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