You are here

protected static function MarkdownTrait::markdown in Markdown 8.2

Same name and namespace in other branches
  1. 3.0.x src/Traits/MarkdownTrait.php \Drupal\markdown\Traits\MarkdownTrait::markdown()

Retrieves the Markdown service.

Return value

\Drupal\markdown\MarkdownInterface The Markdown service.

File

src/Traits/MarkdownTrait.php, line 23

Class

MarkdownTrait
Trait for adding the Markdown service to classes.

Namespace

Drupal\markdown\Traits

Code

protected static function markdown() {
  if (!isset(static::$markdown)) {
    static::$markdown = \Drupal::service('markdown');
  }
  return static::$markdown;
}