interface HelpTopicPluginInterface

Same name in this branch
  1. 10 core/modules/help_topics/src/HelpTopicPluginInterface.php \Drupal\help_topics\HelpTopicPluginInterface
Same name in other branches
  1. 9 core/modules/help_topics/src/HelpTopicPluginInterface.php \Drupal\help_topics\HelpTopicPluginInterface
  2. 8.9.x core/modules/help_topics/src/HelpTopicPluginInterface.php \Drupal\help_topics\HelpTopicPluginInterface
  3. 11.x core/modules/help_topics/src/HelpTopicPluginInterface.php \Drupal\help_topics\HelpTopicPluginInterface
  4. 11.x core/modules/help/src/HelpTopicPluginInterface.php \Drupal\help\HelpTopicPluginInterface

Defines an interface for help topic plugin classes.

Hierarchy

Expanded class hierarchy of HelpTopicPluginInterface

All classes that implement HelpTopicPluginInterface

See also

\Drupal\help\HelpTopicPluginManager

2 files declare their use of HelpTopicPluginInterface
HelpTopicPluginInterface.php in core/modules/help_topics/src/HelpTopicPluginInterface.php
HelpTopicSection.php in core/modules/help/src/Plugin/HelpSection/HelpTopicSection.php

File

core/modules/help/src/HelpTopicPluginInterface.php, line 14

Namespace

Drupal\help
View source
interface HelpTopicPluginInterface extends PluginInspectionInterface, DerivativeInspectionInterface, CacheableDependencyInterface {
    
    /**
     * Returns the label of the topic.
     *
     * @return string
     *   The label of the topic.
     */
    public function getLabel();
    
    /**
     * Returns the body of the topic.
     *
     * @return array
     *   A render array representing the body.
     */
    public function getBody();
    
    /**
     * Returns whether this is a top-level topic or not.
     *
     * @return bool
     *   TRUE if this is a topic that should be displayed on the Help topics
     *   list; FALSE if not.
     */
    public function isTopLevel();
    
    /**
     * Returns the IDs of related topics.
     *
     * @return string[]
     *   Array of the IDs of related topics.
     */
    public function getRelated();
    
    /**
     * Returns the URL for viewing the help topic.
     *
     * @param array $options
     *   (optional) See
     *   \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute() for the
     *    available options.
     *
     * @return \Drupal\Core\Url
     *   A URL object containing the URL for viewing the help topic.
     */
    public function toUrl(array $options = []);
    
    /**
     * Returns a link for viewing the help topic.
     *
     * @param string|null $text
     *   (optional) Link text to use for the link. If NULL, defaults to the
     *   topic title.
     * @param array $options
     *   (optional) See
     *   \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute() for the
     *    available options.
     *
     * @return \Drupal\Core\Link
     *   A link object for viewing the topic.
     */
    public function toLink($text = NULL, array $options = []);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
CacheableDependencyInterface::getCacheContexts public function The cache contexts associated with this object. 34
CacheableDependencyInterface::getCacheMaxAge public function The maximum age for which this object may be cached. 34
CacheableDependencyInterface::getCacheTags public function The cache tags associated with this object. 27
DerivativeInspectionInterface::getBaseId public function Gets the base_plugin_id of the plugin instance. 1
DerivativeInspectionInterface::getDerivativeId public function Gets the derivative_id of the plugin instance. 1
HelpTopicPluginInterface::getBody public function Returns the body of the topic. 2
HelpTopicPluginInterface::getLabel public function Returns the label of the topic. 1
HelpTopicPluginInterface::getRelated public function Returns the IDs of related topics. 1
HelpTopicPluginInterface::isTopLevel public function Returns whether this is a top-level topic or not. 1
HelpTopicPluginInterface::toLink public function Returns a link for viewing the help topic. 1
HelpTopicPluginInterface::toUrl public function Returns the URL for viewing the help topic. 1
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 6
PluginInspectionInterface::getPluginId public function Gets the plugin ID of the plugin instance. 2

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