interface HelpSectionPluginInterface implements PluginInspectionInterface, CacheableDependencyInterface (View source)

Provides an interface for a plugin for a section of the /admin/help page.

Plugins of this type need to be annotated with \Drupal\help\Annotation\HelpSection annotation, and placed in the Plugin\HelpSection namespace directory. They are managed by the \Drupal\help\HelpSectionManager plugin manager class. There is a base class that may be helpful: \Drupal\help\Plugin\HelpSection\HelpSectionPluginBase.

Methods

string
getPluginId()

Gets the plugin_id of the plugin instance.

array
getPluginDefinition()

Gets the definition of the plugin implementation.

string[]
getCacheContexts()

The cache contexts associated with this object.

string[]
getCacheTags()

The cache tags associated with this object.

int
getCacheMaxAge()

The maximum age for which this object may be cached.

string
getTitle()

Returns the title of the help section.

string
getDescription()

Returns the description text for the help section.

array
listTopics()

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

Details

string getPluginId()

Gets the plugin_id of the plugin instance.

Return Value

string

The plugin_id of the plugin instance.

array getPluginDefinition()

Gets the definition of the plugin implementation.

Return Value

array

The plugin definition, as returned by the discovery object used by the plugin manager.

string[] getCacheContexts()

The cache contexts associated with this object.

These identify a specific variation/representation of the object.

Cache contexts are tokens: placeholders that are converted to cache keys by the @cache_contexts_manager service. The replacement value depends on the request context (the current URL, language, and so on). They're converted before storing an object in cache.

Return Value

string[]

An array of cache context tokens, used to generate a cache ID.

See also

CacheContextsManager::convertTokensToKeys

string[] getCacheTags()

The cache tags associated with this object.

When this object is modified, these cache tags will be invalidated.

Return Value

string[]

A set of cache tags.

int getCacheMaxAge()

The maximum age for which this object may be cached.

Return Value

int

The maximum time in seconds that this object may be cached.

string getTitle()

Returns the title of the help section.

Return Value

string

The title text, which could be a plain string or an object that can be cast to a string.

string getDescription()

Returns the description text for the help section.

Return Value

string

The description text, which could be a plain string or an object that can be cast to a string.

array 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.