Class humhub\components\export\Column

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

Column is the base class of all humhub\components\export\SpreadsheetExport column classes.

This class was originally developed by Paul Klimov klimov.paul@gmail.com and his project csv-grid (https://github.com/yii2tech/csv-grid).

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$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
$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
$styles array Containing style information humhub\components\export\Column
$visible boolean Whether this column is visible. humhub\components\export\Column

Public Methods

Hide inherited methods

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

Property Details

$content public property

This is a callable that will be used to generate the content of each cell. The signature of the function should be the following: function ($model, $key, $index, $column). Where $model, $key, and $index refer to the model, key and index of the row currently being rendered and $column is a reference to the humhub\components\export\Column object.

public callable $content null
$dataType public property
public string|null $dataType null
$footer public property

The footer cell content. Note that it will not be HTML-encoded.

public string $footer null
$grid public property

The grid view object that owns this column.

$header public property

The header cell content. Note that it will not be HTML-encoded.

public string $header null
$styles public property
public array $styles = []
$visible public property

Whether this column is visible. Defaults to true.

public boolean $visible true

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

renderFooterCellContent() public method

Renders the footer cell content.

The default implementation simply renders $footer. This method may be overridden to customize the rendering of the footer cell.

public string renderFooterCellContent ( )
return string

The rendering result

renderHeaderCellContent() public method

Renders the header cell content.

The default implementation simply renders $header. This method may be overridden to customize the rendering of the header cell.

public string renderHeaderCellContent ( )
return string

The rendering result