trait MarkdownTrait in Markdown 8.2
Same name and namespace in other branches
- 3.0.x src/Traits/MarkdownTrait.php \Drupal\markdown\Traits\MarkdownTrait
Trait for adding the Markdown service to classes.
Hierarchy
- trait \Drupal\markdown\Traits\MarkdownTrait
File
- src/
Traits/ MarkdownTrait.php, line 8
Namespace
Drupal\markdown\TraitsView source
trait MarkdownTrait {
/**
* The Markdown service.
*
* @var \Drupal\markdown\MarkdownInterface
*/
protected static $markdown;
/**
* Retrieves the Markdown service.
*
* @return \Drupal\markdown\MarkdownInterface
* The Markdown service.
*/
protected static function markdown() {
if (!isset(static::$markdown)) {
static::$markdown = \Drupal::service('markdown');
}
return static::$markdown;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MarkdownTrait:: |
protected static | property | The Markdown service. | |
MarkdownTrait:: |
protected static | function | Retrieves the Markdown service. |