# EventPanel

> Presents dispatched PSR-14 events and contributes their total to the debug 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) › EventPanel

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

Presents dispatched PSR-14 events and contributes their total to the debug toolbar.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`hasContent()`](#method-hasContent) | Reports whether the capture recorded dispatched events worth opening the panel for. | `EventPanel` |
| [`icon()`](#method-icon) | Returns the icon key shared with the built-in Events navigation entry. | `EventPanel` |
| [`id()`](#method-id) | Returns the identifier associating the panel with its slice of the captured payload. | `EventPanel` |
| [`name()`](#method-name) | Returns the panel title shown in the debugger navigation. | `EventPanel` |
| [`render()`](#method-render) | Renders the detail view, letting the page context drive filtering, sorting, and paging. | `EventPanel` |
| [`toolbarItems()`](#method-toolbarItems) | Builds the toolbar metric: the number of events the request dispatched. | `EventPanel` |

## Method details

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

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

Reports whether the capture recorded dispatched events worth opening the panel for.

The capture is listed whenever it carries a payload; the detail page and the toolbar chip surface a malformed
one when they hydrate it.

**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 built-in Events 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: the number of events the request dispatched.

**Parameters**

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

**Returns**

`list<PHPForge\Debug\Toolbar\ToolbarItem>`: Toolbar metrics, or an empty list when the capture dispatched no event.