GridColumnRenderer
API reference › Yii3 Debug › Web › GridColumnRenderer
Renders GridColumn cells, applying the column classes and the pre-built content to the header, filter, and
body cells, and encoding the body content only when the column requests it.
GridView resolves this renderer from GridColumn::getRenderer(), so callers never instantiate it.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
makeFilter() | Declines to build a reader filter: the panels filter their rows before the grid renders. | GridColumnRenderer |
renderBody() | Applies the column classes and the pre-built content to a body cell, encoding it only on request. | GridColumnRenderer |
renderColumn() | Applies the column classes to the column-level cell. | GridColumnRenderer |
renderFilter() | Renders the filter cell, omitting it when the column declares no filter content. | GridColumnRenderer |
renderFooter() | Returns the footer cell unchanged; the grids in this package render no footer content per column. | GridColumnRenderer |
renderHeader() | Applies the column classes and the pre-built header content to the header cell. | GridColumnRenderer |
Method details
Section titled “Method details”makeFilter()
Section titled “makeFilter() ”public function makeFilter(Yii3\Debug\Web\GridColumn<array<array-key, mixed>|object> $column, Yiisoft\Yii\DataView\GridView\Column\Base\MakeFilterContext $context): Yiisoft\Data\Reader\FilterInterface|nullDeclines to build a reader filter: the panels filter their rows before the grid renders.
Parameters
| Parameter | Type | Description |
|---|---|---|
$column | GridColumn<array<array-key, | Column being rendered. |
$context | Yiisoft\ | Filter state supplied by GridView. |
Returns
Yiisoft\Data\Reader\FilterInterface|null: Always null.
renderBody()
Section titled “renderBody() ”public function renderBody(Yii3\Debug\Web\GridColumn<array<array-key, mixed>|object> $column, Yiisoft\Yii\DataView\GridView\Column\Base\Cell $cell, Yiisoft\Yii\DataView\GridView\Column\Base\DataContext $context): Yiisoft\Yii\DataView\GridView\Column\Base\CellApplies the column classes and the pre-built content to a body cell, encoding it only on request.
Parameters
| Parameter | Type | Description |
|---|---|---|
$column | GridColumn<array<array-key, | Column being rendered. |
$cell | Yiisoft\ | Cell to decorate. |
$context | Yiisoft\ | Row state supplied by GridView. |
Returns
Yiisoft\Yii\DataView\GridView\Column\Base\Cell: Decorated body cell.
renderColumn()
Section titled “renderColumn() ”public function renderColumn(Yii3\Debug\Web\GridColumn<array<array-key, mixed>|object> $column, Yiisoft\Yii\DataView\GridView\Column\Base\Cell $cell, Yiisoft\Yii\DataView\GridView\Column\Base\GlobalContext $context): Yiisoft\Yii\DataView\GridView\Column\Base\CellApplies the column classes to the column-level cell.
Parameters
| Parameter | Type | Description |
|---|---|---|
$column | GridColumn<array<array-key, | Column being rendered. |
$cell | Yiisoft\ | Cell to decorate. |
$context | Yiisoft\ | Grid state supplied by GridView. |
Returns
Yiisoft\Yii\DataView\GridView\Column\Base\Cell: Decorated column cell.
renderFilter()
Section titled “renderFilter() ”public function renderFilter(Yii3\Debug\Web\GridColumn<array<array-key, mixed>|object> $column, Yiisoft\Yii\DataView\GridView\Column\Base\Cell $cell, Yiisoft\Yii\DataView\GridView\Column\Base\FilterContext $context): Yiisoft\Yii\DataView\GridView\Column\Base\Cell|nullRenders the filter cell, omitting it when the column declares no filter content.
Parameters
| Parameter | Type | Description |
|---|---|---|
$column | GridColumn<array<array-key, | Column being rendered. |
$cell | Yiisoft\ | Cell to decorate. |
$context | Yiisoft\ | Filter state supplied by GridView. |
Returns
Yiisoft\Yii\DataView\GridView\Column\Base\Cell|null: Decorated filter cell, or null when the column has no filter.
renderFooter()
Section titled “renderFooter() ”public function renderFooter(Yii3\Debug\Web\GridColumn<array<array-key, mixed>|object> $column, Yiisoft\Yii\DataView\GridView\Column\Base\Cell $cell, Yiisoft\Yii\DataView\GridView\Column\Base\GlobalContext $context): Yiisoft\Yii\DataView\GridView\Column\Base\CellReturns the footer cell unchanged; the grids in this package render no footer content per column.
Parameters
| Parameter | Type | Description |
|---|---|---|
$column | GridColumn<array<array-key, | Column being rendered. |
$cell | Yiisoft\ | Cell to decorate. |
$context | Yiisoft\ | Grid state supplied by GridView. |
Returns
Yiisoft\Yii\DataView\GridView\Column\Base\Cell: Decorated footer cell.
renderHeader()
Section titled “renderHeader() ”public function renderHeader(Yii3\Debug\Web\GridColumn<array<array-key, mixed>|object> $column, Yiisoft\Yii\DataView\GridView\Column\Base\Cell $cell, Yiisoft\Yii\DataView\GridView\Column\Base\GlobalContext $context): Yiisoft\Yii\DataView\GridView\Column\Base\CellApplies the column classes and the pre-built header content to the header cell.
Parameters
| Parameter | Type | Description |
|---|---|---|
$column | GridColumn<array<array-key, | Column being rendered. |
$cell | Yiisoft\ | Cell to decorate. |
$context | Yiisoft\ | Grid state supplied by GridView. |
Returns
Yiisoft\Yii\DataView\GridView\Column\Base\Cell: Decorated header cell.