yii\grid\Column::renderDataCellContent PHP Method

renderDataCellContent() protected method

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
    protected function renderDataCellContent($model, $key, $index)
    {
        if ($this->content !== null) {
            return call_user_func($this->content, $model, $key, $index, $this);
        } else {
            return $this->grid->emptyCell;
        }
    }

Usage Example

Example #1
0
 /**
  * @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);
     }
 }
All Usage Examples Of yii\grid\Column::renderDataCellContent