You are here

protected function TokenReplacerBase::get_value in Forena Reports 7.5

Same name and namespace in other branches
  1. 8 src/Token/TokenReplacerBase.php \Drupal\forena\Token\TokenReplacerBase::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 TokenReplacerBase::get_value()
TokenReplacerBase::replace in src/Token/TokenReplacerBase.php

File

src/Token/TokenReplacerBase.php, line 53
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

TokenReplacerBase

Namespace

Drupal\forena\Token

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->formatter) {
    $value = $this->formatter
      ->format($value, $raw_key, $raw);
  }
  return $value;
}