interface HelpTopicPluginInterface implements PluginInspectionInterface, DerivativeInspectionInterface, CacheableDependencyInterface (View source)

internal  Help Topics is currently experimental and should only be leveraged by experimental modules and development releases of contributed modules. See https://www.drupal.org/core/experimental for more information.
 

Defines an interface for help topic plugin classes.

Methods

string
getPluginId()

Gets the plugin_id of the plugin instance.

array
getPluginDefinition()

Gets the definition of the plugin implementation.

string
getBaseId()

Gets the base_plugin_id of the plugin instance.

string|null
getDerivativeId()

Gets the derivative_id of the plugin instance.

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
getLabel()

Returns the label of the topic.

array
getBody()

Returns the body of the topic.

bool
isTopLevel()

Returns whether this is a top-level topic or not.

string[]
getRelated()

Returns the IDs of related topics.

Url
toUrl(array $options = [])

Returns the URL for viewing the help topic.

toLink(string|null $text = NULL, array $options = [])

Returns a link for viewing the help topic.

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 getBaseId()

Gets the base_plugin_id of the plugin instance.

Return Value

string

The base_plugin_id of the plugin instance.

string|null getDerivativeId()

Gets the derivative_id of the plugin instance.

Return Value

string|null

The derivative_id of the plugin instance NULL otherwise.

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 getLabel()

Returns the label of the topic.

Return Value

string

The label of the topic.

array getBody()

Returns the body of the topic.

Return Value

array

A render array representing the body.

bool isTopLevel()

Returns whether this is a top-level topic or not.

Return Value

bool

TRUE if this is a topic that should be displayed on the Help topics list; FALSE if not.

string[] getRelated()

Returns the IDs of related topics.

Return Value

string[]

Array of the IDs of related topics.

Url toUrl(array $options = [])

Returns the URL for viewing the help topic.

Parameters

array $options

(optional) See \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute() for the available options.

Return Value

Url

A URL object containing the URL for viewing the help topic.

Returns a link for viewing the help topic.

Parameters

string|null $text

(optional) Link text to use for the link. If NULL, defaults to the topic title.

array $options

(optional) See \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute() for the available options.

Return Value

Link

A link object for viewing the topic.