File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ public function renderHeader()
125125 return "" ;
126126 }
127127
128- if (empty ($ this ->title ) && !is_callable ($ this ->value )) {
128+ if (empty ($ this ->title ) && !$ this -> isCallable ($ this ->value )) {
129129 if ($ this ->tableInstance ->titlesMode == 'underscore ' ) $ this ->title = $ this ->underscoreToTitle ($ this ->value );
130130 elseif ($ this ->tableInstance ->titlesMode == 'camelcase ' ) $ this ->title = $ this ->camelToTitle ($ this ->value );
131131 }
@@ -178,7 +178,7 @@ public function renderBody( &$row )
178178 $ css = $ this ->css ['td ' ]->render ('{prop}:{val}; ' );
179179
180180 $ val = "" ;
181- if (is_callable ($ this ->value )) {
181+ if ($ this -> isCallable ($ this ->value )) {
182182 $ val = $ this ->value ;
183183 $ val = $ val ($ row );
184184 }
@@ -216,6 +216,15 @@ private function underscoreToTitle($str)
216216
217217 return $ str ;
218218 }
219-
220-
219+
220+
221+ /**
222+ * @param string $var
223+ * @return boolean
224+ */
225+ private function isCallable ($ var )
226+ {
227+ return (!is_string ($ var ) && is_callable ($ var )) || (is_object ($ var ) && $ var instanceof \Closure);
228+ }
229+
221230}
You can’t perform that action at this time.
0 commit comments