# HistoryCellRenderer

> Renders the History index summary header + the per-cell HTML consumed by the grid columns and the typed row-attributes builder.

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [View](/docs/extensions/debug-core/reference/view/index.md) › [History](/docs/extensions/debug-core/reference/view/history/index.md) › HistoryCellRenderer

| final class | `PHPForge\Debug\View\History\HistoryCellRenderer` |
| --- | --- |
| Source | [`src/View/History/HistoryCellRenderer.php`](https://github.com/php-forge/debug-core/blob/main/src/View/History/HistoryCellRenderer.php#L21) |

Renders the History index summary header + the per-cell HTML consumed by the grid columns and the typed
row-attributes builder.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`buildRowAttributes()`](#method-buildRowAttributes) static | Builds the row-attributes map for one captured-request row. The `data-*` attributes feed the sidebar's history cursor. | `HistoryCellRenderer` |
| [`renderAjaxCell()`](#method-renderAjaxCell) static | Renders the AJAX column cell (`'Yes'` / `'No'`). | `HistoryCellRenderer` |
| [`renderDurationCell()`](#method-renderDurationCell) static | Renders the duration column cell (`'X ms'` or `'(not set)'` muted placeholder when missing), with a micro-gauge rail scaled against the page maximum when one exists. | `HistoryCellRenderer` |
| [`renderMemoryCell()`](#method-renderMemoryCell) static | Renders the memory column cell (`'X.XXX MB'` or `'(not set)'`), with a micro-gauge rail scaled against the page maximum when one exists. | `HistoryCellRenderer` |
| [`renderMethodCell()`](#method-renderMethodCell) static | Renders the method column cell as vocabulary-colored text, or an empty string when the method was not captured. | `HistoryCellRenderer` |
| [`renderSqlCountCell()`](#method-renderSqlCountCell) static | Renders the SQL-query column cell (count + warning chip + deep-link to the DB panel). | `HistoryCellRenderer` |
| [`renderStatusCell()`](#method-renderStatusCell) static | Renders the status-code badge cell; an uncaptured (`0`) code renders the muted dash pill, never a `200`. | `HistoryCellRenderer` |
| [`renderSummary()`](#method-renderSummary) static | Renders the summary header (`<header class="yii-debug-grid-summary">`) with the request total and the status-bucket pills. | `HistoryCellRenderer` |
| [`renderTagCell()`](#method-renderTagCell) static | Renders the request-tag column cell as a link to the panel view. | `HistoryCellRenderer` |
| [`renderTimeCell()`](#method-renderTimeCell) static | Renders the time column cell — compact `HH:MM:SS` with a full `Y-m-d H:i:s` tooltip on hover. | `HistoryCellRenderer` |
| [`renderUrlCell()`](#method-renderUrlCell) static | Renders the URL column cell with a hover-truncate wrapper. | `HistoryCellRenderer` |

## Method details

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

```php
public static function buildRowAttributes(PHPForge\Debug\View\History\HistoryRow $row, bool $isCritical): array<string, mixed>
```

Builds the row-attributes map for one captured-request row. The `data-*` attributes feed the sidebar's history
cursor.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`HistoryRow`](/docs/extensions/debug-core/reference/view/history/historyrow/index.md) | Typed history row. |
| `$isCritical` | `bool` | Whether the row's status code counts as critical (adds the danger row class). |

**Returns**

`array<string, mixed>`

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

```php
public static function renderAjaxCell(PHPForge\Debug\View\History\HistoryRow $row): string
```

Renders the AJAX column cell (`'Yes'` / `'No'`).

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`HistoryRow`](/docs/extensions/debug-core/reference/view/history/historyrow/index.md) |  |

**Returns**

`string`

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

```php
public static function renderDurationCell(PHPForge\Debug\View\History\HistoryRow $row, float $maxProcessingTime): string
```

Renders the duration column cell (`'X ms'` or `'(not set)'` muted placeholder when missing), with a micro-gauge
rail scaled against the page maximum when one exists.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`HistoryRow`](/docs/extensions/debug-core/reference/view/history/historyrow/index.md) | Typed history row. |
| `$maxProcessingTime` | `float` | Page maximum in seconds ([`HistoryScale::$maxProcessingTime`](/docs/extensions/debug-core/reference/view/history/historyscale/index.md#property-maxProcessingTime)). |

**Returns**

`string`

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

```php
public static function renderMemoryCell(PHPForge\Debug\View\History\HistoryRow $row, int $maxPeakMemory): string
```

Renders the memory column cell (`'X.XXX MB'` or `'(not set)'`), with a micro-gauge rail scaled against the page
maximum when one exists.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`HistoryRow`](/docs/extensions/debug-core/reference/view/history/historyrow/index.md) | Typed history row. |
| `$maxPeakMemory` | `int` | Page maximum in bytes ([`HistoryScale::$maxPeakMemory`](/docs/extensions/debug-core/reference/view/history/historyscale/index.md#property-maxPeakMemory)). |

**Returns**

`string`

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

```php
public static function renderMethodCell(PHPForge\Debug\View\History\HistoryRow $row): string
```

Renders the method column cell as vocabulary-colored text, or an empty string when the method was not captured.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`HistoryRow`](/docs/extensions/debug-core/reference/view/history/historyrow/index.md) |  |

**Returns**

`string`

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

```php
public static function renderSqlCountCell(PHPForge\Debug\View\History\HistoryRow $row, string $url, bool $isQueryCountCritical, int $criticalQueryThreshold): string
```

Renders the SQL-query column cell (count + warning chip + deep-link to the DB panel).

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`HistoryRow`](/docs/extensions/debug-core/reference/view/history/historyrow/index.md) | Typed history row. |
| `$url` | `string` | Pre-built link target to the DB panel view for this request. |
| `$isQueryCountCritical` | `bool` | Whether the row's query count exceeds the critical threshold. |
| `$criticalQueryThreshold` | `int` | Threshold surfaced in the warning tooltip when the count is critical. |

**Returns**

`string`

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

```php
public static function renderStatusCell(PHPForge\Debug\View\History\HistoryRow $row): string
```

Renders the status-code badge cell; an uncaptured (`0`) code renders the muted dash pill, never a `200`.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`HistoryRow`](/docs/extensions/debug-core/reference/view/history/historyrow/index.md) |  |

**Returns**

`string`

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

```php
public static function renderSummary(PHPForge\Debug\View\History\HistorySummary $summary, array<string, string> $bucketUrls, string $pageSizeHtml): string
```

Renders the summary header (`<header class="yii-debug-grid-summary">`) with the request total and the
status-bucket pills.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$summary` | [`HistorySummary`](/docs/extensions/debug-core/reference/view/history/historysummary/index.md) | Typed summary aggregate. |
| `$bucketUrls` | `array<string, string>` | Bucket-label-to-URL map for the pill deep links (missing labels render without an `href`). |
| `$pageSizeHtml` | `string` | Pre-rendered page-size selector markup supplied by the adapter. |

**Returns**

`string`

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

```php
public static function renderTagCell(PHPForge\Debug\View\History\HistoryRow $row, string $url): string
```

Renders the request-tag column cell as a link to the panel view.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`HistoryRow`](/docs/extensions/debug-core/reference/view/history/historyrow/index.md) | Typed history row. |
| `$url` | `string` | Pre-built link target to the request's panel view. |

**Returns**

`string`

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

```php
public static function renderTimeCell(PHPForge\Debug\View\History\HistoryRow $row): string
```

Renders the time column cell — compact `HH:MM:SS` with a full `Y-m-d H:i:s` tooltip on hover.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`HistoryRow`](/docs/extensions/debug-core/reference/view/history/historyrow/index.md) |  |

**Returns**

`string`

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

```php
public static function renderUrlCell(PHPForge\Debug\View\History\HistoryRow $row): string
```

Renders the URL column cell with a hover-truncate wrapper.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`HistoryRow`](/docs/extensions/debug-core/reference/view/history/historyrow/index.md) |  |

**Returns**

`string`