Class humhub\components\export\DateTimeColumn

Inheritancehumhub\components\export\DateTimeColumn » humhub\components\export\DataColumn » humhub\components\export\Column » yii\base\BaseObject

DateTimeColumn exports DateTime values to humhub\components\export\SpreadsheetExport widget.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$attribute string The attribute name associated with this column. humhub\components\export\DataColumn
$content callable This is a callable that will be used to generate the content of each cell. humhub\components\export\Column
$dataType string|null Specify data type humhub\components\export\Column
$footer string The footer cell content. humhub\components\export\Column
$format string|array In which format should the value of each data model be displayed as (e.g. "raw", "text", "html", ['date', 'php:Y-m-d']). humhub\components\export\DataColumn
$grid humhub\components\export\SpreadsheetExport The grid view object that owns this column. humhub\components\export\Column
$header string The header cell content. humhub\components\export\Column
$label string Label to be displayed in the header cell. humhub\components\export\DataColumn
$styles array Containing style information humhub\components\export\DateTimeColumn
$value string|Closure Anonymous function or a string that is used to determine the value for the current column. humhub\components\export\DataColumn
$visible boolean Whether this column is visible. humhub\components\export\Column

Public Methods

Hide inherited methods

MethodDescriptionDefined By
getDataCellValue() Returns the data cell value. humhub\components\export\DataColumn
renderDataCellContent() Renders the data cell content. humhub\components\export\DateTimeColumn
renderFooterCellContent() Renders the footer cell content. humhub\components\export\Column
renderHeaderCellContent() Renders the header cell content. humhub\components\export\DataColumn

Property Details

$styles public property
public array $styles = ['numberFormat' => ['formatCode' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME]]

Method Details

renderDataCellContent() public method

Renders the data cell content.

public string renderDataCellContent ( $model, $key, $index )
$model mixed

The data model

$key mixed

The key associated with the data model

$index integer

Zero-based index of data model among models array returned by \humhub\components\export\GridView::dataProvider.

return string

The rendering result