function HelpTopicPluginBase::toLink

Same name in other branches
  1. 9 core/modules/help_topics/src/HelpTopicPluginBase.php \Drupal\help_topics\HelpTopicPluginBase::toLink()
  2. 8.9.x core/modules/help_topics/src/HelpTopicPluginBase.php \Drupal\help_topics\HelpTopicPluginBase::toLink()
  3. 11.x core/modules/help/src/HelpTopicPluginBase.php \Drupal\help\HelpTopicPluginBase::toLink()

Overrides HelpTopicPluginInterface::toLink

File

core/modules/help/src/HelpTopicPluginBase.php, line 55

Class

HelpTopicPluginBase
Base class for help topic plugins.

Namespace

Drupal\help

Code

public function toLink($text = NULL, array $options = []) {
    if (!$text) {
        $text = $this->getLabel();
    }
    return Link::createFromRoute($text, 'help.help_topic', [
        'id' => $this->getPluginId(),
    ], $options);
}

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