Test if value is instance of \Closure

This commit is contained in:
Thiago Talma
2014-01-30 17:01:26 -02:00
parent f906b3a10b
commit 5a2323346d

View File

@ -141,7 +141,7 @@ class DataColumn extends Column
protected function renderDataCellContent($model, $key, $index)
{
if ($this->value !== null) {
if (is_callable($this->value)) {
if ($this->value instanceof \Closure) {
$value = call_user_func($this->value, $model, $index, $this);
} else {
$value = ArrayHelper::getValue($model, $this->value);