You are here

public function InstallablePluginBase::getLabel in Markdown 8.2

Displays the human-readable label of the plugin.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup The label.

Overrides AnnotatedPluginBase::getLabel

File

src/Plugin/Markdown/InstallablePluginBase.php, line 248

Class

InstallablePluginBase
Base class for installable plugins.

Namespace

Drupal\markdown\Plugin\Markdown

Code

public function getLabel($version = TRUE) {
  $label = $this->pluginDefinition->label ?: $this->pluginDefinition
    ->getId();
  try {
    if ($version && ($version = $this
      ->getVersion())) {
      $label .= " ({$version})";
    }
  } catch (MissingVersionException $exception) {

    // Intentionally do nothing.
  }
  return $label;
}