Change condition

This commit is contained in:
Thiago Talma
2014-01-30 17:04:16 -02:00
parent 5a2323346d
commit 8c49dabb1b

View File

@ -141,10 +141,10 @@ 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 ($this->value instanceof \Closure) { if (is_string($this->value)) {
$value = call_user_func($this->value, $model, $index, $this);
} else {
$value = ArrayHelper::getValue($model, $this->value); $value = ArrayHelper::getValue($model, $this->value);
} else {
$value = call_user_func($this->value, $model, $index, $this);
} }
} 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);