ProviderPanel
API reference › Yii3 Debug › Panel › ProviderPanel
3 subclasses
Adapts any provider-owned declarative panel to the Yii3 debugger.
The presentation is built on first use and memoized for the payload it was built from, so the listing check, the toolbar metrics, and the detail page of one capture share a single provider call.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates an adapter for a provider-owned declarative panel. | ProviderPanel |
hasContent() | Returns whether the capture holds a presentation for this panel. | ProviderPanel |
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() | Builds the toolbar metrics the provider declares for a capture. | ProviderPanel |
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\Panel $provider)Creates an adapter for a provider-owned declarative panel.
Parameters
| Parameter | Type | Description |
|---|---|---|
$provider | PHPForge\ | Declarative panel supplying the identity and presentation. |
hasContent()
Section titled “hasContent() ”public function hasContent(array<string, mixed> $payload): boolReturns whether the capture holds a presentation for this panel.
An extension the application enabled stays listed even on a capture where it recorded no activity, so its own empty state explains the idle capture instead of the entry disappearing from the sidebar. Building the presentation here keeps a failing provider discoverable, because the failure reaches the host, and it primes the memo the toolbar and the detail page read next.
Parameters
| Parameter | Type | Description |
|---|---|---|
$payload | array<string, | Serialized panel payload. |
Returns
bool: true, since the host only asks once the capture carries this panel’s payload.
Throws
Throwable: if the provider cannot present the payload.
icon()
Section titled “icon() ”public function icon(): stringReturns the shared Debug Core icon key.
Returns
string: Effective icon key, falling back to the provider default.
public function id(): stringReturns the stable identifier of this panel.
Returns
string: Stable panel ID declared by the provider.
name()
Section titled “name() ”public function name(): stringReturns the human-readable panel name.
Returns
string: Effective display name, falling back to the provider default.
render()
Section titled “render() ”public function render(Yii3\Debug\Panel\PanelRenderInput $input): stringRenders the detail content the provider produces for a capture.
Only the payload reaches the provider, so the portable presentation stays independent of the host request.
Parameters
| Parameter | Type | Description |
|---|---|---|
$input | PanelRenderInput | Payload, request context, and request summary of the page being rendered. |
Returns
string: Rendered detail content.
Throws
Throwable: if the provider cannot present the payload.
toolbarItems()
Section titled “toolbarItems() ”public function toolbarItems(array<string, mixed> $payload): list<PHPForge\Debug\Toolbar\ToolbarItem>Builds the toolbar metrics the provider declares for a capture.
Parameters
| Parameter | Type | Description |
|---|---|---|
$payload | array<string, | Serialized panel payload. |
Returns
list<PHPForge\Debug\Toolbar\ToolbarItem>: Toolbar metrics declared by the provider.
Throws
Throwable: if the provider cannot present the payload.
withMetadata()
Section titled “withMetadata() ”public function withMetadata(string $title, string $icon): selfReturns a copy presenting the panel under the metadata the application configured.
The detail heading, the sidebar entry, and the toolbar chip all read the effective title, so the panel keeps
one name across the debugger while ProviderPanel::id() stays the stable capture key.
Parameters
| Parameter | Type | Description |
|---|---|---|
$title | string | Effective display title. |
$icon | string | Effective icon key. |
Returns
self: Adapter presenting the configured metadata, with an empty memo.