You are here

public function BaseParser::getLabel in Markdown 3.0.x

Displays the human-readable label of the plugin.

Parameters

bool $version: Flag indicating whether to show the version with the label.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup The label.

Overrides MarkdownInstallablePluginInterface::getLabel

File

src/Plugin/Markdown/BaseParser.php, line 339

Class

BaseParser
Plugin annotation @MarkdownParser( id = "_broken", label = @Translation("Missing Parser"), )

Namespace

Drupal\markdown\Plugin\Markdown

Code

public function getLabel($version = TRUE) {
  if (!$version) {
    return $this->pluginDefinition['label'];
  }
  $variables['@label'] = $this->pluginDefinition['label'];
  $variables['@version'] = $this
    ->getVersion();
  return $variables['@version'] ? $this
    ->t('@label (@version)', $variables) : $variables['@label'];
}