SimpleExcel.php
authorAlan Knowles <alan@roojs.com>
Tue, 18 Oct 2016 04:47:09 +0000 (12:47 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 18 Oct 2016 04:47:09 +0000 (12:47 +0800)
SimpleExcel.php

index c3cc062..cf29b8f 100644 (file)
@@ -328,8 +328,13 @@ class Pman_Core_SimpleExcel extends Pman
                 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;
                 }