Renders the data cell content.
protected renderDataCellContent ( mixed $model, mixed $key, integer $index ) : string | ||
$model | mixed | the data model |
$key | mixed | the key associated with the data model |
$index | integer | the zero-based index of the data model among the models array returned by [[GridView::dataProvider]]. |
return | string | the rendering result |
/** * @inheritdoc */ protected function renderDataCellContent($model, $key, $index) { if ($this->content === null) { return $this->grid->formatter->format($this->getDataCellValue($model, $key, $index), $this->format); } else { return parent::renderDataCellContent($model, $key, $index); } }
/** * @inheritdoc */ protected function renderDataCellContent($model, $key, $index) { if ($this->value !== null) { $value = call_user_func($this->value, $model, $index, $this); } elseif ($this->content === null && $this->attribute !== null) { $value = ArrayHelper::getValue($model, $this->attribute); } else { return parent::renderDataCellContent($model, $key, $index); } return $this->grid->formatter->format($value, $this->format); }