public Link::toString()
Generates the HTML for this Link object.
Do not use this method to render a link in an HTML context. In an HTML context, self::toRenderable() should be used so that render cache information is maintained. However, there might be use cases such as tests and non-HTML contexts where calling this method directly makes sense.
\Drupal\Core\GeneratedLink The link HTML markup.
\Drupal\Core\Link::toRenderable()
public function toString() { return $this->getLinkGenerator()->generateFromLink($this); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Link.php/function/Link::toString/8.1.x