PHP Класс yii\grid\Column

С версии: 2.0
Автор: Qiang Xue ([email protected])
Наследование: extends yii\base\Object
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$content 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 Column object.
$contentOptions the HTML attributes for the data cell tag. This can either be an array of attributes or an anonymous function ([[Closure]]) that returns such an array. 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 Column object. A function may be used to assign different attributes to different rows based on the data in that row.
$filterOptions the HTML attributes for the filter cell tag.
$footer the footer cell content. Note that it will not be HTML-encoded.
$footerOptions the HTML attributes for the footer cell tag.
$grid the grid view object that owns this column.
$header the header cell content. Note that it will not be HTML-encoded.
$headerOptions the HTML attributes for the header cell tag.
$options the HTML attributes for the column group tag.
$visible whether this column is visible. Defaults to true.

Открытые методы

Метод Описание
renderDataCell ( mixed $model, mixed $key, integer $index ) : string Renders a data cell.
renderFilterCell ( ) Renders the filter cell.
renderFooterCell ( ) Renders the footer cell.
renderHeaderCell ( ) Renders the header cell.

Защищенные методы

Метод Описание
getHeaderCellLabel ( ) : string Returns header cell label.
renderDataCellContent ( mixed $model, mixed $key, integer $index ) : string Renders the data cell content.
renderFilterCellContent ( ) : string Renders the filter cell content.
renderFooterCellContent ( ) : string Renders the footer cell content.
renderHeaderCellContent ( ) : string Renders the header cell content.

Описание методов

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

This method may be overridden to customize the label of the header cell.
С версии: 2.0.8
protected getHeaderCellLabel ( ) : string
Результат string label

renderDataCell() публичный Метод

Renders a data cell.
public renderDataCell ( mixed $model, mixed $key, integer $index ) : string
$model mixed the data model being rendered
$key mixed the key associated with the data model
$index integer the zero-based index of the data item among the item array returned by [[GridView::dataProvider]].
Результат string the rendering result

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

renderFilterCell() публичный Метод

Renders the filter cell.
public renderFilterCell ( )

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

The default implementation simply renders a space. This method may be overridden to customize the rendering of the filter cell (if any).
protected renderFilterCellContent ( ) : string
Результат string the rendering result

renderFooterCell() публичный Метод

Renders the footer cell.
public renderFooterCell ( )

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

The default implementation simply renders [[footer]]. This method may be overridden to customize the rendering of the footer cell.
protected renderFooterCellContent ( ) : string
Результат string the rendering result

renderHeaderCell() публичный Метод

Renders the header cell.
public renderHeaderCell ( )

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

The default implementation simply renders [[header]]. This method may be overridden to customize the rendering of the header cell.
protected renderHeaderCellContent ( ) : string
Результат string the rendering result

Описание свойств

$content публичное свойство

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 Column object.
public $content

$contentOptions публичное свойство

the HTML attributes for the data cell tag. This can either be an array of attributes or an anonymous function ([[Closure]]) that returns such an array. 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 Column object. A function may be used to assign different attributes to different rows based on the data in that row.
См. также: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $contentOptions

$filterOptions публичное свойство

the HTML attributes for the filter cell tag.
См. также: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $filterOptions

$footerOptions публичное свойство

the HTML attributes for the footer cell tag.
См. также: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $footerOptions

$grid публичное свойство

the grid view object that owns this column.
public $grid

$header публичное свойство

the header cell content. Note that it will not be HTML-encoded.
public $header

$headerOptions публичное свойство

the HTML attributes for the header cell tag.
См. также: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $headerOptions

$options публичное свойство

the HTML attributes for the column group tag.
См. также: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $options

$visible публичное свойство

whether this column is visible. Defaults to true.
public $visible