You are here

public function TagPluginBase::getSample in Extensible BBCode 8.3

Same name and namespace in other branches
  1. 4.0.x src/Plugin/TagPluginBase.php \Drupal\xbbcode\Plugin\TagPluginBase::getSample()

Return a sample tag for the filter tips.

This sample should reference the configured tag name.

Return value

string The sample code.

Overrides TagPluginInterface::getSample

File

src/Plugin/TagPluginBase.php, line 148

Class

TagPluginBase
Provides a base class for XBBCode tag plugins.

Namespace

Drupal\xbbcode\Plugin

Code

public function getSample() : string {
  if (!$this->sample) {
    $this->sample = str_replace('{{ name }}', $this->name, trim($this
      ->getDefaultSample()));
  }
  return $this->sample;
}