public function EntityTagPlugin::getTemplate in Extensible BBCode 8.3
Same name and namespace in other branches
- 4.0.x src/Plugin/XBBCode/EntityTagPlugin.php \Drupal\xbbcode\Plugin\XBBCode\EntityTagPlugin::getTemplate()
Get the tag template.
Return value
\Twig_TemplateWrapper The compiled template that should render this tag.
Throws
Overrides TemplateTagPlugin::getTemplate
File
- src/
Plugin/ XBBCode/ EntityTagPlugin.php, line 93
Class
- EntityTagPlugin
- A tag plugin based on a custom tag entity.
Namespace
Drupal\xbbcode\Plugin\XBBCodeCode
public function getTemplate() : Twig_TemplateWrapper {
// Lazily prepare the template, if it does not exist yet.
if ($this->template === NULL) {
$entity = $this
->getEntity();
$code = $entity
->getTemplateCode();
$file = $entity
->getTemplateFile();
$this->template = $file && !$code ? $file : self::TEMPLATE_PREFIX . $code;
}
// Delegate template-loading to the parent.
return parent::getTemplate();
}