You are here

protected function FrxSyntaxEngine::get_value in Forena Reports 7.3

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.4 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

$data:

$key:

Return value

unknown_type

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

File

./FrxSyntaxEngine.inc, line 48
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 (!$raw && $this->formatter) {
    $value = trim($this->formatter
      ->format($value, $raw_key));
  }
  return $value;
}