You are here

public static function FrxRenderer::addAttributes in Forena Reports 7.3

Same name and namespace in other branches
  1. 7.4 renderers/FrxRenderer.inc \FrxRenderer::addAttributes()
1 call to FrxRenderer::addAttributes()
FrxRenderer::mergedAttributes in ./FrxRenderer.inc
Standard php array containing merged attributes Enter description here ...

File

./FrxRenderer.inc, line 55
FrxRenderer.inc Base class for Frx custom renderers @author davidmetzler

Class

FrxRenderer
@file FrxRenderer.inc Base class for Frx custom renderers @author davidmetzler

Code

public static function addAttributes(&$attributes, $key, $value) {
  $parts = explode('_', $key);
  $suff = '';
  if (count($parts) > 1) {
    $suff = array_pop($parts);
    $part = implode('_', $parts);
  }

  // If we have _0 _1 _2 attributes convert them into arrays.
  if ((int) $suff || $suff === '0') {
    $attributes[$part][] = (string) $value;
  }
  else {
    $attributes[$key] = (string) $value;
  }
}