# DebugPageRenderer

> Renders debugger pages and optional extension panels with the shared Debug Core shell.

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

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

Renders debugger pages and optional extension panels with the shared Debug Core shell.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Creates the page renderer with its view, assets, configuration, templates, and debugger routes. | `DebugPageRenderer` |
| [`compare()`](#method-compare) | Renders the comparison page for two captures. | `DebugPageRenderer` |
| [`config()`](#method-config) | Renders the live configuration page. | `DebugPageRenderer` |
| [`extension()`](#method-extension) | Renders one captured extension panel. | `DebugPageRenderer` |
| [`hasExtensionPanel()`](#method-hasExtensionPanel) | Returns whether a panel is registered under the given ID. | `DebugPageRenderer` |
| [`history()`](#method-history) | Renders the captured request history. | `DebugPageRenderer` |
| [`phpInfo()`](#method-phpInfo) | Renders the `phpinfo()` page inside the debugger shell. | `DebugPageRenderer` |
| [`withExtensionPanels()`](#method-withExtensionPanels) | Returns a copy carrying the extension panels shown in the sidebar. | `DebugPageRenderer` |

## Method details

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

```php
public function __construct(Yiisoft\View\WebView $view, Yiisoft\Assets\AssetManager $assetManager, Yii3\Debug\ConfigDataFactory $configDataFactory, string $viewPath, Yii3\Debug\Middleware\ToolbarOptions $options = new \Yii3\Debug\Middleware\ToolbarOptions())
```

Creates the page renderer with its view, assets, configuration, templates, and debugger routes.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$view` | `Yiisoft\View\WebView` | View rendering the debugger templates. |
| `$assetManager` | `Yiisoft\Assets\AssetManager` | Manager resolving the published URLs of the debugger assets. |
| `$configDataFactory` | [`Yii3\Debug\ConfigDataFactory`](/docs/extensions/yii3-debug/reference/configdatafactory/index.md) | Factory building the live configuration payload. |
| `$viewPath` | `string` | Directory the debugger templates are read from. |
| `$options` | [`Yii3\Debug\Middleware\ToolbarOptions`](/docs/extensions/yii3-debug/reference/middleware/toolbaroptions/index.md) | Settings carrying the route prefix every debugger URL is built on. |

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

```php
public function compare(Yii3\Debug\Comparison\HistoryComparison $comparison, array<string, PHPForge\Debug\Storage\RequestSummary> $manifest, string $theme): 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. |
| `$theme` | `string` | Resolved theme: `'light'` or `'dark'`. |

**Returns**

`string`: Rendered debugger page.

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

```php
public function config(string $tag, string $theme, array<string, PHPForge\Debug\Storage\RequestSummary> $manifest = [], PHPForge\Debug\Storage\DebugSnapshot|null $snapshot = null): string
```

Renders the live configuration page.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$tag` | `string` | Capture in context, used by the sidebar links. |
| `$theme` | `string` | Resolved theme: `'light'` or `'dark'`. |
| `$manifest` | `array<string, PHPForge\Debug\Storage\RequestSummary>` | Captured request summaries keyed by tag. |
| `$snapshot` | `PHPForge\Debug\Storage\DebugSnapshot\|null` | Capture backing the sidebar, or `null` when none is selected. |

**Returns**

`string`: Rendered debugger page.

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

```php
public function extension(PHPForge\Debug\Storage\DebugSnapshot $snapshot, string $panelId, string $theme, array<string, PHPForge\Debug\Storage\RequestSummary> $manifest = [], array<array-key, mixed> $queryParams = []): string
```

Renders one captured extension panel.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$snapshot` | `PHPForge\Debug\Storage\DebugSnapshot` | Capture the panel renders. |
| `$panelId` | `string` | Panel to render. |
| `$theme` | `string` | Resolved theme: `'light'` or `'dark'`. |
| `$manifest` | `array<string, PHPForge\Debug\Storage\RequestSummary>` | Captured request summaries keyed by tag. |
| `$queryParams` | `array<array-key, mixed>` | Raw query parameters of the debugger request. |

**Returns**

`string`: Rendered debugger page.

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

```php
public function hasExtensionPanel(string $panelId): bool
```

Returns whether a panel is registered under the given ID.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$panelId` | `string` | Panel to look up. |

**Returns**

`bool`: `true` when the panel is registered; `false` otherwise.

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

```php
public function history(array<string, PHPForge\Debug\Storage\RequestSummary> $manifest, array<array-key, mixed> $queryParams, string $theme, PHPForge\Debug\Storage\DebugSnapshot|null $snapshot = null): string
```

Renders the captured request history.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$manifest` | `array<string, PHPForge\Debug\Storage\RequestSummary>` | Captured request summaries keyed by tag. |
| `$queryParams` | `array<array-key, mixed>` | Raw query parameters of the debugger request. |
| `$theme` | `string` | Resolved theme: `'light'` or `'dark'`. |
| `$snapshot` | `PHPForge\Debug\Storage\DebugSnapshot\|null` | Capture backing the sidebar, or `null` when none is selected. |

**Returns**

`string`: Rendered debugger page.

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

```php
public function phpInfo(string $theme, array<string, PHPForge\Debug\Storage\RequestSummary> $manifest = [], PHPForge\Debug\Storage\DebugSnapshot|null $snapshot = null): string
```

Renders the `phpinfo()` page inside the debugger shell.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$theme` | `string` | Resolved theme: `'light'` or `'dark'`. |
| `$manifest` | `array<string, PHPForge\Debug\Storage\RequestSummary>` | Captured request summaries keyed by tag. |
| `$snapshot` | `PHPForge\Debug\Storage\DebugSnapshot\|null` | Capture backing the sidebar, or `null` when none is selected. |

**Returns**

`string`: Rendered debugger page.

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

```php
public function withExtensionPanels(iterable<Yii3\Debug\Panel\ExtensionPanelInterface> $extensionPanels): self
```

Returns a copy carrying the extension panels shown in the sidebar.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$extensionPanels` | `iterable<`[`Yii3\Debug\Panel\ExtensionPanelInterface`](/docs/extensions/yii3-debug/reference/panel/extensionpanelinterface/index.md)`>` | Optional panel presenters in sidebar order. |

**Returns**

`self`: Renderer with the panels applied.