public function HelpTopicPluginBase::toLink in Drupal 10
Same name and namespace in other branches
- 8 core/modules/help_topics/src/HelpTopicPluginBase.php \Drupal\help_topics\HelpTopicPluginBase::toLink()
- 9 core/modules/help_topics/src/HelpTopicPluginBase.php \Drupal\help_topics\HelpTopicPluginBase::toLink()
File
- core/
modules/ help_topics/ src/ HelpTopicPluginBase.php, line 57
Class
- HelpTopicPluginBase
- Base class for help topic plugins.
Namespace
Drupal\help_topicsCode
public function toLink($text = NULL, array $options = []) {
if (!$text) {
$text = $this
->getLabel();
}
return Link::createFromRoute($text, 'help.help_topic', [
'id' => $this
->getPluginId(),
], $options);
}