# GridColumnRenderer

> Renders Yii3\Debug\Web\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.

[API reference](/docs/api/index.md) › [Yii3 Debug](/docs/extensions/yii3-debug/reference/index.md) › [Web](/docs/extensions/yii3-debug/reference/web/index.md) › GridColumnRenderer

| final class | `Yii3\Debug\Web\GridColumnRenderer` |
| --- | --- |
| Implements | `Yiisoft\Yii\DataView\GridView\Column\FilterableColumnRendererInterface` |
| Source | [`src/Web/GridColumnRenderer.php`](https://github.com/yii3/debug/blob/main/src/Web/GridColumnRenderer.php#L20) |

Renders [`GridColumn`](/docs/extensions/yii3-debug/reference/web/gridcolumn/index.md) 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()`](/docs/extensions/yii3-debug/reference/web/gridcolumn/index.md#method-getRenderer), so callers never instantiate it.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`makeFilter()`](#method-makeFilter) | Declines to build a reader filter: the panels filter their rows before the grid renders. | `GridColumnRenderer` |
| [`renderBody()`](#method-renderBody) | Applies the column classes and the pre-built content to a body cell, encoding it only on request. | `GridColumnRenderer` |
| [`renderColumn()`](#method-renderColumn) | Applies the column classes to the column-level cell. | `GridColumnRenderer` |
| [`renderFilter()`](#method-renderFilter) | Renders the filter cell, omitting it when the column declares no filter content. | `GridColumnRenderer` |
| [`renderFooter()`](#method-renderFooter) | Returns the footer cell unchanged; the grids in this package render no footer content per column. | `GridColumnRenderer` |
| [`renderHeader()`](#method-renderHeader) | Applies the column classes and the pre-built header content to the header cell. | `GridColumnRenderer` |

## Method details

### makeFilter() <span id="method-makeFilter"></span>

```php
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|null
```

Declines to build a reader filter: the panels filter their rows before the grid renders.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$column` | [`GridColumn`](/docs/extensions/yii3-debug/reference/web/gridcolumn/index.md)`<array<array-key, mixed>\|object>` | Column being rendered. |
| `$context` | `Yiisoft\Yii\DataView\GridView\Column\Base\MakeFilterContext` | Filter state supplied by GridView. |

**Returns**

`Yiisoft\Data\Reader\FilterInterface|null`: Always `null`.

### renderBody() <span id="method-renderBody"></span>

```php
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\Cell
```

Applies the column classes and the pre-built content to a body cell, encoding it only on request.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$column` | [`GridColumn`](/docs/extensions/yii3-debug/reference/web/gridcolumn/index.md)`<array<array-key, mixed>\|object>` | Column being rendered. |
| `$cell` | `Yiisoft\Yii\DataView\GridView\Column\Base\Cell` | Cell to decorate. |
| `$context` | `Yiisoft\Yii\DataView\GridView\Column\Base\DataContext` | Row state supplied by GridView. |

**Returns**

`Yiisoft\Yii\DataView\GridView\Column\Base\Cell`: Decorated body cell.

### renderColumn() <span id="method-renderColumn"></span>

```php
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\Cell
```

Applies the column classes to the column-level cell.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$column` | [`GridColumn`](/docs/extensions/yii3-debug/reference/web/gridcolumn/index.md)`<array<array-key, mixed>\|object>` | Column being rendered. |
| `$cell` | `Yiisoft\Yii\DataView\GridView\Column\Base\Cell` | Cell to decorate. |
| `$context` | `Yiisoft\Yii\DataView\GridView\Column\Base\GlobalContext` | Grid state supplied by GridView. |

**Returns**

`Yiisoft\Yii\DataView\GridView\Column\Base\Cell`: Decorated column cell.

### renderFilter() <span id="method-renderFilter"></span>

```php
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|null
```

Renders the filter cell, omitting it when the column declares no filter content.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$column` | [`GridColumn`](/docs/extensions/yii3-debug/reference/web/gridcolumn/index.md)`<array<array-key, mixed>\|object>` | Column being rendered. |
| `$cell` | `Yiisoft\Yii\DataView\GridView\Column\Base\Cell` | Cell to decorate. |
| `$context` | `Yiisoft\Yii\DataView\GridView\Column\Base\FilterContext` | 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() <span id="method-renderFooter"></span>

```php
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\Cell
```

Returns the footer cell unchanged; the grids in this package render no footer content per column.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$column` | [`GridColumn`](/docs/extensions/yii3-debug/reference/web/gridcolumn/index.md)`<array<array-key, mixed>\|object>` | Column being rendered. |
| `$cell` | `Yiisoft\Yii\DataView\GridView\Column\Base\Cell` | Cell to decorate. |
| `$context` | `Yiisoft\Yii\DataView\GridView\Column\Base\GlobalContext` | Grid state supplied by GridView. |

**Returns**

`Yiisoft\Yii\DataView\GridView\Column\Base\Cell`: Decorated footer cell.

### renderHeader() <span id="method-renderHeader"></span>

```php
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\Cell
```

Applies the column classes and the pre-built header content to the header cell.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$column` | [`GridColumn`](/docs/extensions/yii3-debug/reference/web/gridcolumn/index.md)`<array<array-key, mixed>\|object>` | Column being rendered. |
| `$cell` | `Yiisoft\Yii\DataView\GridView\Column\Base\Cell` | Cell to decorate. |
| `$context` | `Yiisoft\Yii\DataView\GridView\Column\Base\GlobalContext` | Grid state supplied by GridView. |

**Returns**

`Yiisoft\Yii\DataView\GridView\Column\Base\Cell`: Decorated header cell.