You are here

protected function FrxSyntaxEngine::get_value in Forena Reports 7.4

Same name and namespace in other branches
  1. 6.2 FrxSyntaxEngine.inc \FrxSyntaxEngine::get_value()
  2. 6 FrxSyntaxEngine.inc \FrxSyntaxEngine::get_value()
  3. 7 FrxSyntaxEngine.inc \FrxSyntaxEngine::get_value()
  4. 7.2 FrxSyntaxEngine.inc \FrxSyntaxEngine::get_value()
  5. 7.3 FrxSyntaxEngine.inc \FrxSyntaxEngine::get_value()

Get the value from the data. This is used by token_replace method to extract the data based on the path provided.

Parameters

string $key: Key name used to access data.

bool $raw: True implies that value will not be formatted. Defaults to FALSE.

Return value

string Value of the data

1 call to FrxSyntaxEngine::get_value()
FrxSyntaxEngine::replace in ./FrxSyntaxEngine.inc

File

./FrxSyntaxEngine.inc, line 57
FrXSytnaxEngine defines how regular expression procesing/token substitution takes place. It includes support for passing in a formatter oobject that will escape strings properly before substituting them.

Class

FrxSyntaxEngine
@file FrXSytnaxEngine defines how regular expression procesing/token substitution takes place. It includes support for passing in a formatter oobject that will escape strings properly before substituting them.

Code

protected function get_value($key, $raw = FALSE) {
  $context = '';
  $raw_key = $key;
  if ($key && strpos($key, '.')) {
    @(list($context, $key) = explode('.', $key, 2));
    $o = Frx::Context($context);
  }
  else {
    $o = $this->data;
  }
  $value = $o
    ->getValue($key, $context);
  if ($this->tpattern == FRX_TOKEN_EXP && $this->htmlencode) {
    $value = htmlentities($value, NULL, 'UTF-8');
  }
  if ($this->formatter) {
    $value = $this->formatter
      ->format($value, $raw_key, $raw);
  }
  return $value;
}