# DumpPanel

> Presents the values dumped during the request as the Yii2 Dump grid and contributes the dump count to the toolbar.

[API reference](/docs/api/index.md) › [Yii3 Debug](/docs/extensions/yii3-debug/reference/index.md) › [Panel](/docs/extensions/yii3-debug/reference/panel/index.md) › DumpPanel

| final readonly class | `Yii3\Debug\Panel\DumpPanel` |
| --- | --- |
| Implements | [`ToolbarPanelProviderInterface`](/docs/extensions/yii3-debug/reference/panel/toolbarpanelproviderinterface/index.md) |
| Source | [`src/Panel/DumpPanel.php`](https://github.com/yii3/debug/blob/main/src/Panel/DumpPanel.php#L33) |

Presents the values dumped during the request as the Yii2 Dump grid and contributes the dump count to the toolbar.

The grid chrome is host-rendered like the Logs grid, while every dump card comes from
[`DumpCardRenderer`](https://github.com/php-forge/debug-core/blob/53c259241281d3275cd5cbfa64f08eb986d6bce3/src/Panel/Dump/DumpCardRenderer.php), so a capture written by either host renders the same cells. Filters reuse the `Log[...]`
group of [`LogSearch`](/docs/extensions/yii3-debug/reference/search/logsearch/index.md), as the Yii2 Dump grid does.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Creates the Dump panel with its configured call-site renderer. | `DumpPanel` |
| [`hasContent()`](#method-hasContent) | Reports whether the capture recorded a Dump payload worth opening the panel for. | `DumpPanel` |
| [`icon()`](#method-icon) | Returns the icon key shared with the Yii2 Dump navigation entry. | `DumpPanel` |
| [`id()`](#method-id) | Returns the identifier associating the panel with its slice of the captured payload. | `DumpPanel` |
| [`name()`](#method-name) | Returns the panel title shown in the debugger navigation. | `DumpPanel` |
| [`render()`](#method-render) | Renders the detail view, letting the page context drive filtering, sorting, and paging. | `DumpPanel` |
| [`toolbarItems()`](#method-toolbarItems) | Builds the toolbar metric counting the dumped variables, as the Yii2 Dump chip does. | `DumpPanel` |

## Method details

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

```php
public function __construct(PHPForge\Debug\Helper\Trace $trace)
```

Creates the Dump panel with its configured call-site renderer.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$trace` | [`Trace`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/Helper/Trace.php) | Configured renderer of the call-site frames shown in the dump cards. |

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

```php
public function hasContent(array<string, mixed> $payload): bool
```

Reports whether the capture recorded a Dump payload worth opening the panel for.

The capture is listed whenever it carries a payload, as in Yii2, so a request without dumps shows the empty
state.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$payload` | `array<string, mixed>` | Serialized panel payload. |

**Returns**

`bool`: `true` when the capture carried data; `false` otherwise.

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

```php
public function icon(): string
```

Returns the icon key shared with the Yii2 Dump navigation entry.

**Returns**

`string`: Shared Debug Core icon key.

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

```php
public function id(): string
```

Returns the identifier associating the panel with its slice of the captured payload.

**Returns**

`string`: Stable panel identifier.

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

```php
public function name(): string
```

Returns the panel title shown in the debugger navigation.

**Returns**

`string`: Human-readable panel name.

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

```php
public function render(Yii3\Debug\Panel\PanelRenderInput $input): string
```

Renders the detail view, letting the page context drive filtering, sorting, and paging.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$input` | [`PanelRenderInput`](/docs/extensions/yii3-debug/reference/panel/panelrenderinput/index.md) | Payload, request context, and request summary of the page being rendered. |

**Returns**

`string`: Rendered panel markup.

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

```php
public function toolbarItems(array<string, mixed> $payload): list<PHPForge\Debug\Toolbar\ToolbarItem>
```

Builds the toolbar metric counting the dumped variables, as the Yii2 Dump chip does.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$payload` | `array<string, mixed>` | Serialized panel payload. |

**Returns**

`list<PHPForge\Debug\Toolbar\ToolbarItem>`: The count metric, or an empty list when nothing was dumped.