public function generateRow($model, $key, $index)
{
/**
* @var Column $column
*/
$this->_endCol = 0;
foreach ($this->getVisibleColumns() as $column) {
if ($column instanceof SerialColumn) {
$value = $column->renderDataCell($model, $key, $index);
} elseif ($column instanceof ActionColumn) {
$value = '';
} else {
$format = $this->enableFormatter && isset($column->format) ? $column->format : 'raw';
$value = $column->content === null ? method_exists($column, 'getDataCellValue') ? $this->formatter->format($column->getDataCellValue($model, $key, $index), $format) : $column->renderDataCell($model, $key, $index) : call_user_func($column->content, $model, $key, $index, $column);
}
if (empty($value) && !empty($column->attribute) && $column->attribute !== null) {
$value = ArrayHelper::getValue($model, $column->attribute, '');
}
$this->_endCol++;
$cell = $this->_objPHPExcelSheet->setCellValue(self::columnName($this->_endCol) . ($index + $this->_beginRow + 1), empty($value) && !strlen($value) ? '' : strip_tags($value), true);
$this->raiseEvent('onRenderDataCell', [$cell, $value, $model, $key, $index, $this]);
}
}