After few examples pointed before, how to make links and urls,
lets combine it all together and have a proper way how to use it, even with t function for translations.
use Drupal\Core\Link; use Drupal\Core\Url; $link = Link::fromTextAndUrl('This is an example link', Url::fromRoute('entity.node.canonical', ['node' => 11])); $this->t('You should click this %link' ['%link' => $link->toString()])
Also an important note about links is that links and URLs are considered value objects and therefore don't need to be injected. You must use the classes directly.