MailPanel
API reference › Yii3 Debug › Panel › MailPanel
Adapts the framework-neutral PHPForge Mail panel to the Yii3 debugger.
The detail view, the sidebar entry, and the toolbar metric match the Yii2 Mail panel: a capture that sent mail counts its own messages, and a capture that sent none but directly follows one that did, the redirect after a form post, links the metric to that request.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Binds the adapter to the shared Mail presentation. | MailPanel |
hasContent() | Reports whether the Mail collector captured the request. | MailPanel |
icon() | Returns the shared Debug Core icon key. | ProviderPanel |
id() | Returns the stable identifier of this panel. | ProviderPanel |
name() | Returns the human-readable panel name. | ProviderPanel |
render() | Renders the detail content the provider produces for a capture. | ProviderPanel |
toolbarItems() | Counts the messages the capture sent. | MailPanel |
toolbarItemsForCapture() | Counts the messages the capture sent, or links the previous request when it sent the mail instead. | MailPanel |
withMetadata() | Returns a copy presenting the panel under the metadata the application configured. | ProviderPanel |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(PHPForge\Debug\Storage\SnapshotStore $store, Yii3\Debug\Middleware\ToolbarOptions $options = new \Yii3\Debug\Middleware\ToolbarOptions())Binds the adapter to the shared Mail presentation.
Parameters
| Parameter | Type | Description |
|---|---|---|
$store | PHPForge\ | Store whose manifest locates the request that preceded a capture. |
$options | Yii3\ | Settings carrying the route prefix the cross-request link is built on. |
hasContent()
Section titled “hasContent() ”public function hasContent(array<string, mixed> $payload): boolReports whether the Mail collector captured the request.
A capture without messages stays listed and shows the panel empty state, as the Yii2 sidebar does.
Parameters
| Parameter | Type | Description |
|---|---|---|
$payload | array<string, | Serialized panel payload. |
Returns
bool: true when the collector produced a payload; false otherwise.
toolbarItems()
Section titled “toolbarItems() ”public function toolbarItems(array<string, mixed> $payload): list<PHPForge\Debug\Toolbar\ToolbarItem>Counts the messages the capture sent.
Parameters
| Parameter | Type | Description |
|---|---|---|
$payload | array<string, | Serialized panel payload. |
Returns
list<PHPForge\Debug\Toolbar\ToolbarItem>: One metric carrying the message count, or an empty list when none was sent.
Throws
PHPForge\Debug\Storage\HydrationException: when the payload does not match the Mail snapshot schema.
toolbarItemsForCapture()
Section titled “toolbarItemsForCapture() ”public function toolbarItemsForCapture(string $tag, array<string, mixed> $payload): list<PHPForge\Debug\Toolbar\ToolbarItem>Counts the messages the capture sent, or links the previous request when it sent the mail instead.
The previous request is the manifest entry right after the capture, newest first; a capture not listed yet falls back to the newest entry.
Parameters
| Parameter | Type | Description |
|---|---|---|
$tag | string | Tag of the capture the toolbar describes. |
$payload | array<string, | Serialized panel payload of that capture. |
Returns
list<PHPForge\Debug\Toolbar\ToolbarItem>: The own count, a cross-request metric linking the previous request, or an empty list when neither sent mail.
Throws
PHPForge\Debug\Storage\HydrationException: when the payload does not match the Mail snapshot schema.