You are here

public static function Frx::Context in Forena Reports 7.5

Same name and namespace in other branches
  1. 7.3 Frx.inc \Frx::Context()
  2. 7.4 Frx.inc \Frx::Context()

Factory object to get the context based on a name. IF the context doesn't exist we assume the default data context (FrxData).

Parameters

$context string:

Return value

FrxContext

1 call to Frx::Context()
TokenReplacerBase::get_value in src/Token/TokenReplacerBase.php
Get the value from the data. This is used by token_replace method to extract the data based on the path provided.

File

./Frx.inc, line 294
Frx.incL General Forena Reporting Class

Class

Frx

Code

public static function Context($context) {
  $o = NULL;

  // Instantiate the class if it exists
  if ($context) {
    $o = Frx::getDriver('FrxContext', $context);
  }

  // Otherwise instantiate the data class.
  if (!$o) {
    $o = Frx::Data();
  }
  return $o;
}