You are here

private function XBBCodeFilter::renderTree in Extensible BBCode 8.2

1 call to XBBCodeFilter::renderTree()
XBBCodeFilter::process in src/Plugin/Filter/XBBCodeFilter.php
Performs the filter processing.

File

src/Plugin/Filter/XBBCodeFilter.php, line 200
Contains Drupal\xbbcode\Plugin\Filter\XBBCodeFilter.

Class

XBBCodeFilter
Provides a filter that converts BBCode to HTML.

Namespace

Drupal\xbbcode\Plugin\Filter

Code

private function renderTree($tree) {
  $output = '';
  foreach ($tree as $root) {
    if (is_object($root)) {
      $root->content = $this
        ->renderTree($root->content);
      $rendered = $this
        ->renderTag($root);
      $root = $rendered !== NULL ? $rendered : $root
        ->getOuterText();
    }
    $output .= $root;
  }
  return $output;
}