# HistoryRowRenderer

> Renders the History index summary header + the per-cell HTML consumed by the GridView columns and the typed rowOptions builder.

[API reference](/docs/api/index.md) › [Debug](/docs/extensions/debug/reference/index.md) › [widgets](/docs/extensions/debug/reference/widgets/index.md) › [history](/docs/extensions/debug/reference/widgets/history/index.md) › HistoryRowRenderer

| final class | `yii\debug\widgets\history\HistoryRowRenderer` |
| --- | --- |
| Source | [`src/widgets/history/HistoryRowRenderer.php`](https://github.com/yii2-extensions/debug/blob/main/src/widgets/history/HistoryRowRenderer.php#L25) |

Renders the History index summary header + the per-cell HTML consumed by the GridView columns and the typed
`rowOptions` builder.

Stateless static helpers; every method takes a typed [`HistoryRow`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/View/History/HistoryRow.php) or [`HistorySummary`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/View/History/HistorySummary.php) and returns a
ready-to-echo HTML string (or, for the row options builder, the attribute map the GridView consumes for `<tr>`).

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`buildRowOptions()`](#method-buildRowOptions) static | Builds the `rowOptions` attribute map for one captured-request row. The `data-*` attributes feed the sidebar's history cursor. | `HistoryRowRenderer` |
| [`renderAjaxCell()`](#method-renderAjaxCell) static | Renders the AJAX column cell (`'Yes'` / `'No'`). | `HistoryRowRenderer` |
| [`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. | `HistoryRowRenderer` |
| [`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. | `HistoryRowRenderer` |
| [`renderMethodCell()`](#method-renderMethodCell) static | Renders the method column cell as vocabulary-colored text, or an empty string when the method was not captured. | `HistoryRowRenderer` |
| [`renderSqlCountCell()`](#method-renderSqlCountCell) static | Renders the SQL-query column cell (count + warning chip + deep-link to the DB panel). | `HistoryRowRenderer` |
| [`renderStatusCell()`](#method-renderStatusCell) static | Renders the status column cell as a tone badge of the HTTP status code, or a muted dash pill when the code was not captured (`0`). | `HistoryRowRenderer` |
| [`renderSummary()`](#method-renderSummary) static | Renders the summary header (`<header class="yii-debug-grid-summary">`) with the request total and the status-bucket pills. | `HistoryRowRenderer` |
| [`renderTagCell()`](#method-renderTagCell) static | Renders the request-tag column cell as a link to the panel view. | `HistoryRowRenderer` |
| [`renderTimeCell()`](#method-renderTimeCell) static | Renders the time column cell — compact `HH:MM:SS` with a full `yyyy-MM-dd HH:mm:ss` tooltip on hover. | `HistoryRowRenderer` |
| [`renderUrlCell()`](#method-renderUrlCell) static | Renders the URL column cell with a hover-truncate wrapper. | `HistoryRowRenderer` |

## Method details

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

```php
public static function buildRowOptions(PHPForge\Debug\View\History\HistoryRow $row, yii\debug\models\search\DebugSearch $searchModel): array<string, mixed>
```

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

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`HistoryRow`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/View/History/HistoryRow.php) | Typed history row. |
| `$searchModel` | [`yii\debug\models\search\DebugSearch`](/docs/extensions/debug/reference/models/search/debugsearch/index.md) | Search model deciding whether the row's status counts as critical. |

**Returns**

`array<string, mixed>`: Attribute map the GridView applies to the `<tr>`.

### 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`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/View/History/HistoryRow.php) | Typed history row. |

**Returns**

`string`: Rendered cell.

### 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`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/View/History/HistoryRow.php) | Typed history row. |
| `$maxProcessingTime` | `float` | Page maximum in seconds ([`HistoryScale::$maxProcessingTime`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/View/History/HistoryScale.php#L18)). |

**Returns**

`string`: Rendered cell.

### 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`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/View/History/HistoryRow.php) | Typed history row. |
| `$maxPeakMemory` | `int` | Page maximum in bytes ([`HistoryScale::$maxPeakMemory`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/View/History/HistoryScale.php#L22)). |

**Returns**

`string`: Rendered cell.

### 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`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/View/History/HistoryRow.php) | Typed history row. |

**Returns**

`string`: Rendered cell, or `''` when no method was captured.

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

```php
public static function renderSqlCountCell(PHPForge\Debug\View\History\HistoryRow $row, yii\debug\panels\DbPanel $dbPanel): string
```

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

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`HistoryRow`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/View/History/HistoryRow.php) | Typed history row. |
| `$dbPanel` | [`yii\debug\panels\DbPanel`](/docs/extensions/debug/reference/panels/dbpanel/index.md) | Panel supplying the critical-query threshold. |

**Returns**

`string`: Rendered cell.

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

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

Renders the status column cell as a tone badge of the HTTP status code, or a muted dash pill when the code was
not captured (`0`).

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`HistoryRow`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/View/History/HistoryRow.php) | Typed history row. |

**Returns**

`string`: Rendered cell.

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

```php
public static function renderSummary(PHPForge\Debug\View\History\HistorySummary $summary): 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`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/View/History/HistorySummary.php) | Totals and status buckets for the listed captures. |

**Returns**

`string`: Rendered header, or `''` when no request was captured.

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

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

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

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`HistoryRow`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/View/History/HistoryRow.php) | Typed history row. |

**Returns**

`string`: Rendered cell.

### 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 `yyyy-MM-dd HH:mm:ss` tooltip on hover.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$row` | [`HistoryRow`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/View/History/HistoryRow.php) | Typed history row. |

**Returns**

`string`: Rendered cell, or a muted placeholder when no time was captured.

### 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`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/View/History/HistoryRow.php) | Typed history row. |

**Returns**

`string`: Rendered cell.