renderDataCellContent() защищенный Метод

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]].
Результат string the rendering result
Пример #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);
     }
 }
 /**
  * @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);
 }