You are here

public function TestHelpSection::listTopics in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/help_topics/tests/modules/help_topics_test/src/Plugin/HelpSection/TestHelpSection.php \Drupal\help_topics_test\Plugin\HelpSection\TestHelpSection::listTopics()
  2. 10 core/modules/help_topics/tests/modules/help_topics_test/src/Plugin/HelpSection/TestHelpSection.php \Drupal\help_topics_test\Plugin\HelpSection\TestHelpSection::listTopics()

Returns a list of topics to show in the help section.

Return value

array A sorted list of topic links or render arrays for topic links. The links will be shown in the help section; if the returned array of links is empty, the section will be shown with some generic empty text.

Overrides HelpSectionPluginInterface::listTopics

File

core/modules/help_topics/tests/modules/help_topics_test/src/Plugin/HelpSection/TestHelpSection.php, line 27

Class

TestHelpSection
Provides a searchable help section for testing.

Namespace

Drupal\help_topics_test\Plugin\HelpSection

Code

public function listTopics() {
  return [
    Link::fromTextAndUrl('Foo', Url::fromUri('https://foo.com')),
    Link::fromTextAndUrl('Bar', Url::fromUri('https://bar.com')),
  ];
}