# HistoryComparisonRenderer

> Renders capture-comparison selection and results with the shared Debug Core primitives.

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

| final class | `Yii3\Debug\Web\HistoryComparisonRenderer` |
| --- | --- |
| Source | [`src/Web/HistoryComparisonRenderer.php`](https://github.com/yii3/debug/blob/main/src/Web/HistoryComparisonRenderer.php#L35) |

Renders capture-comparison selection and results with the shared Debug Core primitives.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`render()`](#method-render) static | Renders the comparison page for two captures. | `HistoryComparisonRenderer` |
| [`renderForm()`](#method-renderForm) static | Renders the capture-selection form of the comparison page. | `HistoryComparisonRenderer` |
| [`renderHistoryForm()`](#method-renderHistoryForm) static | Renders the compact comparison form embedded in the history page. | `HistoryComparisonRenderer` |
| [`renderWithPanels()`](#method-renderWithPanels) static | Renders links only for panels registered by the current adapter. | `HistoryComparisonRenderer` |

## Method details

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

```php
public static function render(Yii3\Debug\Comparison\HistoryComparison $comparison, array<string, PHPForge\Debug\Storage\RequestSummary> $manifest, string $routePrefix): string
```

Renders the comparison page for two captures.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$comparison` | [`Yii3\Debug\Comparison\HistoryComparison`](/docs/extensions/yii3-debug/reference/comparison/historycomparison/index.md) | Differences between the two captures. |
| `$manifest` | `array<string, PHPForge\Debug\Storage\RequestSummary>` | Captured request summaries keyed by tag. |
| `$routePrefix` | `string` | Base route used to generate debugger URLs. |

**Returns**

`string`: Rendered comparison page.

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

```php
public static function renderForm(array<string, PHPForge\Debug\Storage\RequestSummary> $manifest, string $baseline, string $target, string $routePrefix): string
```

Renders the capture-selection form of the comparison page.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$manifest` | `array<string, PHPForge\Debug\Storage\RequestSummary>` | Captured request summaries keyed by tag. |
| `$baseline` | `string` | Tag currently selected as the baseline. |
| `$target` | `string` | Tag currently selected as the target. |
| `$routePrefix` | `string` | Base route used to generate debugger URLs. |

**Returns**

`string`: Rendered form.

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

```php
public static function renderHistoryForm(array<string, PHPForge\Debug\Storage\RequestSummary> $manifest, string $routePrefix): string
```

Renders the compact comparison form embedded in the history page.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$manifest` | `array<string, PHPForge\Debug\Storage\RequestSummary>` | Captured request summaries keyed by tag. |
| `$routePrefix` | `string` | Base route used to generate debugger URLs. |

**Returns**

`string`: Rendered form, or `''` when fewer than two captures are available.

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

```php
public static function renderWithPanels(Yii3\Debug\Comparison\HistoryComparison $comparison, array<string, PHPForge\Debug\Storage\RequestSummary> $manifest, string $routePrefix, array<string, string> $panelLabels): string
```

Renders links only for panels registered by the current adapter.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$comparison` | [`Yii3\Debug\Comparison\HistoryComparison`](/docs/extensions/yii3-debug/reference/comparison/historycomparison/index.md) | Differences between the two captures. |
| `$manifest` | `array<string, PHPForge\Debug\Storage\RequestSummary>` | Captured request summaries keyed by tag. |
| `$routePrefix` | `string` | Base route used to generate debugger URLs. |
| `$panelLabels` | `array<string, string>` | Registered display names indexed by panel ID. |

**Returns**

`string`: Rendered comparison page.