You are here

public function Formatter::template in Forena Reports 8

Indicates the data in the field is a template that can be used by forena to format.

Parameters

string $value:

string $format_string:

ReportReplacer $teng:

Return value

string Formatted field

File

src/FrxPlugin/FieldFormatter/Formatter.php, line 214
contains various methods for extending report formating, layout, transformation and design.

Class

Formatter
Formatter for common drupal fields.

Namespace

Drupal\forena\FrxPlugin\FieldFormatter

Code

public function template($value, $format_string, $teng, $default) {
  if (!$value) {
    $value = $default;
  }
  if ($value) {
    $value = $teng
      ->replace($value);
    $value = html_entity_decode($value, ENT_QUOTES, 'UTF-8');
    if ($format_string && filter_format_exists($format_string)) {
      $value = check_markup($value, $format_string);
    }
  }
  return $value;
}