'dataFormat' => 'string' // to force a string..
'width'=> 75,
'renderer' => array($this, 'getThumb'),
- 'txtrenderer' => array($this, 'cleanValue'), // for
+ 'txtrenderer' => array($this, 'cleanValue'), // for text content...
'color' => 'yellow', // set color for the cell which is a header element
'fillBlank' => 'gray', // set the color for the cell which is a blank area
),
continue;
}
if (isset($col_cfg['renderer'])) {
+
+ if (is_a($col_cfg['renderer'], 'Closure')) {
+ $col_cfg['renderer']->call($cl[$col_cfg['dataIndex']], $worksheet, $r+1, $c, $cl);
+ } else {
// not sure if row is correct here...!!!?
- call_user_func($col_cfg['renderer'], $cl[$col_cfg['dataIndex']], $worksheet, $r+1, $c, $cl);
+ call_user_func($col_cfg['renderer'], $cl[$col_cfg['dataIndex']], $worksheet, $r+1, $c, $cl);
+ }
}
// echo "<PRE>WRITE: ". htmlspecialchars(print_r(array($r+1, $c, $cl[$col_cfg['dataIndex']]), true));
continue;
}
if (isset($col_cfg['txtrenderer'])) {
- $v = call_user_func($col_cfg['txtrenderer'],
- $cl[$col_cfg['dataIndex']], $worksheet, $r+1, $c, $clo);
+
+ if (is_a($col_cfg['txtrenderer'], 'Closure')) {
+ $v = $col_cfg['txtrenderer']->call($cl[$col_cfg['dataIndex']], $worksheet, $r+1, $c, $clo);
+ } else {
+ $v = call_user_func($col_cfg['txtrenderer'],
+ $cl[$col_cfg['dataIndex']], $worksheet, $r+1, $c, $clo);
+ }
if ($v === false) {
continue;
}