mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 14:26:54 +08:00
Test if value is instance of \Closure
This commit is contained in:
@ -141,11 +141,11 @@ class DataColumn extends Column
|
||||
protected function renderDataCellContent($model, $key, $index)
|
||||
{
|
||||
if ($this->value !== null) {
|
||||
if (is_callable($this->value)) {
|
||||
$value = call_user_func($this->value, $model, $index, $this);
|
||||
} else {
|
||||
$value = ArrayHelper::getValue($model, $this->value);
|
||||
}
|
||||
if ($this->value instanceof \Closure) {
|
||||
$value = call_user_func($this->value, $model, $index, $this);
|
||||
} else {
|
||||
$value = ArrayHelper::getValue($model, $this->value);
|
||||
}
|
||||
} elseif ($this->content === null && $this->attribute !== null) {
|
||||
$value = ArrayHelper::getValue($model, $this->attribute);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user