HelpSectionPluginInterface.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace Drupal\help;
  3. use Drupal\Component\Plugin\PluginInspectionInterface;
  4. use Drupal\Core\Cache\CacheableDependencyInterface;
  5. /**
  6. * Provides an interface for a plugin for a section of the /admin/help page.
  7. *
  8. * Plugins of this type need to be annotated with
  9. * \Drupal\help\Annotation\HelpSection annotation, and placed in the
  10. * Plugin\HelpSection namespace directory. They are managed by the
  11. * \Drupal\help\HelpSectionManager plugin manager class. There is a base
  12. * class that may be helpful:
  13. * \Drupal\help\Plugin\HelpSection\HelpSectionPluginBase.
  14. */
  15. interface HelpSectionPluginInterface extends PluginInspectionInterface, CacheableDependencyInterface {
  16. /**
  17. * Returns the title of the help section.
  18. *
  19. * @return string
  20. * The title text, which could be a plain string or an object that can be
  21. * cast to a string.
  22. */
  23. public function getTitle();
  24. /**
  25. * Returns the description text for the help section.
  26. *
  27. * @return string
  28. * The description text, which could be a plain string or an object that
  29. * can be cast to a string.
  30. */
  31. public function getDescription();
  32. /**
  33. * Returns a list of topics to show in the help section.
  34. *
  35. * @return array
  36. * A sorted list of topic links or render arrays for topic links. The links
  37. * will be shown in the help section; if the returned array of links is
  38. * empty, the section will be shown with some generic empty text.
  39. */
  40. public function listTopics();
  41. }