You are here

public function RendererBase::replaceTokens in Forena Reports 7.5

A helper function to allow replacement of tokens from inside a renderer wihout needing to understand the object

Parameters

unknown $text:

string $raw_mode Field:

Return value

Ambigous <unknown_type, text, mixed, string, unknown>

1 call to RendererBase::replaceTokens()
FrxSVGGraph::renderGraph in src/Renderer/FrxSVGGraph.php

File

src/Renderer/RendererBase.php, line 65
FrxRenderer.php Base class for Frx custom Renderer @author davidmetzler

Class

RendererBase

Namespace

Drupal\forena\Renderer

Code

public function replaceTokens($text, $raw_mode = FALSE) {
  if (is_array($text)) {
    foreach ($text as $k => $v) {
      $text[$k] = $this
        ->replaceTokens($v, $raw_mode);
    }
    return $text;
  }
  elseif (is_object($text)) {
    foreach ($text as $k => $v) {
      $text->{$k} = $this
        ->replaceTokens($v, $raw_mode);
    }
    return $text;
  }
  else {
    return $this->frxReport
      ->replace($text, $raw_mode);
  }
}