You are here

public static function RendererBase::addAttributes in Forena Reports 7.5

Helper function for convergint methods to a standard associated array.

Parameters

unknown $attributes:

unknown $key:

unknown $value:

1 call to RendererBase::addAttributes()
RendererBase::mergedAttributes in src/Renderer/RendererBase.php
Standard php array containing merged attributes Enter description here ...

File

src/Renderer/RendererBase.php, line 381
FrxRenderer.php Base class for Frx custom Renderer @author davidmetzler

Class

RendererBase

Namespace

Drupal\forena\Renderer

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;
  }
}