# RequestPanel

> Presents the captured PSR-7 request and response with the shared Yii Request panel UI.

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

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

Presents the captured PSR-7 request and response with the shared Yii Request panel UI.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Creates the Request panel with the optional live route collection. | `RequestPanel` |
| [`hasContent()`](#method-hasContent) | Reports whether the capture recorded request data worth opening the panel for. | `RequestPanel` |
| [`icon()`](#method-icon) | Returns the icon key shared with the built-in Request navigation entry. | `RequestPanel` |
| [`id()`](#method-id) | Returns the identifier associating the panel with its slice of the captured payload. | `RequestPanel` |
| [`name()`](#method-name) | Returns the panel title shown in the debugger navigation. | `RequestPanel` |
| [`render()`](#method-render) | Renders the detail view, letting the manifest entry fill the identity the capture omitted. | `RequestPanel` |
| [`toolbarItems()`](#method-toolbarItems) | Builds the toolbar metrics: the resolved route and the response status. | `RequestPanel` |

## Method details

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

```php
public function __construct(Yiisoft\Router\RouteCollectionInterface|null $routes = null)
```

Creates the Request panel with the optional live route collection.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$routes` | `Yiisoft\Router\RouteCollectionInterface\|null` | Live route collection the overview reads its matched definition and configuration badges from, or `null` when the application registers no router. |

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

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

Reports whether the capture recorded request data worth opening the panel for.

**Parameters**

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

**Returns**

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

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

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

Returns the icon key shared with the built-in Request 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 manifest entry fill the identity the capture omitted.

**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 metrics: the resolved route and the response status.

**Parameters**

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

**Returns**

`list<PHPForge\Debug\Toolbar\ToolbarItem>`: Toolbar metrics in display order.