Commit 5a232334 by Thiago Talma

Test if value is instance of \Closure

parent f906b3a1
...@@ -141,11 +141,11 @@ class DataColumn extends Column ...@@ -141,11 +141,11 @@ class DataColumn extends Column
protected function renderDataCellContent($model, $key, $index) protected function renderDataCellContent($model, $key, $index)
{ {
if ($this->value !== null) { if ($this->value !== null) {
if (is_callable($this->value)) { if ($this->value instanceof \Closure) {
$value = call_user_func($this->value, $model, $index, $this); $value = call_user_func($this->value, $model, $index, $this);
} else { } else {
$value = ArrayHelper::getValue($model, $this->value); $value = ArrayHelper::getValue($model, $this->value);
} }
} elseif ($this->content === null && $this->attribute !== null) { } elseif ($this->content === null && $this->attribute !== null) {
$value = ArrayHelper::getValue($model, $this->attribute); $value = ArrayHelper::getValue($model, $this->attribute);
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment