You are here

public function TagElement::getOuterSource in Extensible BBCode 8.3

Same name and namespace in other branches
  1. 4.0.x src/Parser/Tree/TagElement.php \Drupal\xbbcode\Parser\Tree\TagElement::getOuterSource()

Retrieve the content including the opening and closing tags.

Tags inside the content will still be rendered.

Return value

string|mixed The tag source.

Overrides TagElementInterface::getOuterSource

File

src/Parser/Tree/TagElement.php, line 162

Class

TagElement
A BBCode tag element.

Namespace

Drupal\xbbcode\Parser\Tree

Code

public function getOuterSource() : string {

  // Reconstruct the opening and closing tags, but render the content.
  if (!isset($this->outerSource)) {
    $content = $this
      ->getContent();
    $this->outerSource = "[{$this->name}{$this->argument}]{$content}[/{$this->name}]";
  }
  return $this->outerSource;
}