public static function FrxRenderer::addAttributes in Forena Reports 7.4
Same name and namespace in other branches
- 7.3 FrxRenderer.inc \FrxRenderer::addAttributes()
Helper function for convergint methods to a standard associated array.
Parameters
unknown $attributes:
unknown $key:
unknown $value:
1 call to FrxRenderer::addAttributes()
- FrxRenderer::mergedAttributes in renderers/
FrxRenderer.inc - Standard php array containing merged attributes Enter description here ...
File
- renderers/
FrxRenderer.inc, line 372 - 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;
}
}