# ProviderPanel

> Adapts any provider-owned declarative panel to the Yii2 debugger; no framework-specific presenter is needed.

[API reference](/docs/api/index.md) › [Debug](/docs/extensions/debug/reference/index.md) › [panels](/docs/extensions/debug/reference/panels/index.md) › ProviderPanel

| class | `yii\debug\panels\ProviderPanel` |
| --- | --- |
| Extends | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) » [`yii\base\Component`](/docs/api/yii/base/component/index.md) » [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| Implements | [`yii\base\ViewContextInterface`](/docs/api/yii/base/viewcontextinterface/index.md), [`yii\base\Configurable`](/docs/api/yii/base/configurable/index.md) |
| Source | [`src/panels/ProviderPanel.php`](https://github.com/yii2-extensions/debug/blob/main/src/panels/ProviderPanel.php#L17) |

Adapts any provider-owned declarative panel to the Yii2 debugger; no framework-specific presenter is needed.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-actions"></span>[`$actions`](/docs/extensions/debug/reference/panel/index.md#property-actions) | `array<string, array<string, mixed>\|class-string>` | Standalone actions merged into the debug module's [`Module::$actionMap`](/docs/api/yii/base/module/index.md#property-actionMap), keyed by action ID. Default: `[]`. | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| <span id="property-behaviors"></span>[`$behaviors`](/docs/api/yii/base/component/index.md#property-behaviors) read-only | `array<`[`yii\base\Behavior`](/docs/api/yii/base/behavior/index.md)`<static>>` | List of behaviors attached to this component. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="property-detail"></span>`$detail` read-only | `string` | Rendered detail view. | `ProviderPanel` |
| <span id="property-icon"></span>`$icon` | `string\|null` | Icon key resolved for this registration, or `null` to render the provider default. Default: `null`. | `ProviderPanel` |
| <span id="property-id"></span>[`$id`](/docs/extensions/debug/reference/panel/index.md#property-id) | `string` | Panel unique identifier, assigned by the container module on registration. Default: `''`. | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| <span id="property-module"></span>[`$module`](/docs/extensions/debug/reference/panel/index.md#property-module) | [`yii\debug\Module`](/docs/extensions/debug/reference/module/index.md)`\|null` | Debug module owning this panel. Default: `null`. | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| <span id="property-name"></span>`$name` read-only | `string` | Configured display title, or the one declared by the provider. | `ProviderPanel` |
| <span id="property-provider"></span>`$provider` | `PHPForge\Debug\Panel\|null` | Declarative panel supplying the identity, capture format, and presentation of this registration. Default: `null`. | `ProviderPanel` |
| <span id="property-renderContext"></span>[`$renderContext`](/docs/extensions/debug/reference/panel/index.md#property-renderContext) | `PHPForge\Debug\Panel\PanelRenderContext\|null` | Prepared render context, or `null` outside a debugger request. | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| <span id="property-tag"></span>[`$tag`](/docs/extensions/debug/reference/panel/index.md#property-tag) | `string` | Tag of the request whose data this panel currently exposes. Default: `''`. | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| <span id="property-title"></span>`$title` | `string\|null` | Display title resolved for this registration, or `null` to render the provider default. Default: `null`. | `ProviderPanel` |
| <span id="property-toolbarData"></span>[`$toolbarData`](/docs/extensions/debug/reference/panel/index.md#property-toolbarData) read-only | `array<string, mixed>` | Toolbar envelope; `[]` to skip the panel. | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| <span id="property-toolbarIcon"></span>`$toolbarIcon` read-only | `string` | Configured toolbar icon key, or the one declared by the provider. | `ProviderPanel` |
| <span id="property-url"></span>[`$url`](/docs/extensions/debug/reference/panel/index.md#property-url) read-only | `string` | Absolute URL to the panel detail view. | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| <span id="property-viewPath"></span>[`$viewPath`](/docs/extensions/debug/reference/panel/index.md#property-viewPath) read-only | `string` | Directory the panel views resolve against. | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| <span id="property-error"></span>[`$error`](/docs/extensions/debug/reference/panel/index.md#property-error) protected | `PHPForge\Debug\Storage\ExceptionSnapshot\|null` | Exception captured when the panel failed to produce or hydrate its snapshot. Default: `null`. | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| <span id="method-__construct"></span>[`__construct()`](/docs/api/yii/base/baseobject/index.md#method-__construct) | Constructor. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__call"></span>[`__call()`](/docs/api/yii/base/component/index.md#method-__call) | Calls the named method which is not a class method. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-__clone"></span>[`__clone()`](/docs/api/yii/base/component/index.md#method-__clone) | This method is called after the object is created by cloning an existing one. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-__get"></span>[`__get()`](/docs/api/yii/base/component/index.md#method-__get) | Returns the value of a component property. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-__isset"></span>[`__isset()`](/docs/api/yii/base/component/index.md#method-__isset) | Checks if a property is set, i.e. defined and not null. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-__set"></span>[`__set()`](/docs/api/yii/base/component/index.md#method-__set) | Sets the value of a component property. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-__unset"></span>[`__unset()`](/docs/api/yii/base/component/index.md#method-__unset) | Sets a component property to be null. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-attachBehavior"></span>[`attachBehavior()`](/docs/api/yii/base/component/index.md#method-attachBehavior) | Attaches a behavior to this component. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-attachBehaviors"></span>[`attachBehaviors()`](/docs/api/yii/base/component/index.md#method-attachBehaviors) | Attaches a list of behaviors to the component. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-behaviors"></span>[`behaviors()`](/docs/api/yii/base/component/index.md#method-behaviors) | Returns a list of behaviors that this component should behave as. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-canGetProperty"></span>[`canGetProperty()`](/docs/api/yii/base/component/index.md#method-canGetProperty) | Returns a value indicating whether a property can be read. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-canSetProperty"></span>[`canSetProperty()`](/docs/api/yii/base/component/index.md#method-canSetProperty) | Returns a value indicating whether a property can be set. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-capture"></span>[`capture()`](/docs/extensions/debug/reference/panel/index.md#method-capture) | Captures the panel payload for the current request. | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| <span id="method-className"></span>[`className()`](/docs/api/yii/base/baseobject/index.md#method-className) static | Returns the fully qualified name of this class. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-detachBehavior"></span>[`detachBehavior()`](/docs/api/yii/base/component/index.md#method-detachBehavior) | Detaches a behavior from the component. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-detachBehaviors"></span>[`detachBehaviors()`](/docs/api/yii/base/component/index.md#method-detachBehaviors) | Detaches all behaviors from the component. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-ensureBehaviors"></span>[`ensureBehaviors()`](/docs/api/yii/base/component/index.md#method-ensureBehaviors) | Makes sure that the behaviors declared in [`behaviors()`](/docs/api/yii/base/component/index.md#method-behaviors) are attached to this component. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-getBehavior"></span>[`getBehavior()`](/docs/api/yii/base/component/index.md#method-getBehavior) | Returns the named behavior object. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-getBehaviors"></span>[`getBehaviors()`](/docs/api/yii/base/component/index.md#method-getBehaviors) | Returns all behaviors attached to this component. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| [`getDetail()`](#method-getDetail) | Renders the provider's presentation of the hydrated capture. | `ProviderPanel` |
| <span id="method-getError"></span>[`getError()`](/docs/extensions/debug/reference/panel/index.md#method-getError) | Returns the exception captured while collecting the panel payload, if any. | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| [`getName()`](#method-getName) | Returns the human-readable panel name, preferring the title resolved by the registration policy. | `ProviderPanel` |
| <span id="method-getRenderContext"></span>[`getRenderContext()`](/docs/extensions/debug/reference/panel/index.md#method-getRenderContext) | Returns the framework-neutral render context for the active debugger request, when one has been prepared. | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| <span id="method-getToolbarData"></span>[`getToolbarData()`](/docs/extensions/debug/reference/panel/index.md#method-getToolbarData) | Returns the toolbar envelope wrapping the panel's icon, items, and URL. | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| [`getToolbarIcon()`](#method-getToolbarIcon) | Returns the shared Debug Core icon key, preferring the one resolved by the registration policy. | `ProviderPanel` |
| <span id="method-getTraceLine"></span>[`getTraceLine()`](/docs/extensions/debug/reference/panel/index.md#method-getTraceLine) | Builds a trace line for the toolbar through the shared [`Trace`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/Helper/Trace.php) renderer, applying [`Module::$tracePathMappings`](/docs/extensions/debug/reference/module/index.md#property-tracePathMappings) and the configured [`Module::$traceLine`](/docs/extensions/debug/reference/module/index.md#property-traceLine) template (or callable). | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| <span id="method-getUrl"></span>[`getUrl()`](/docs/extensions/debug/reference/panel/index.md#method-getUrl) | Returns the URL pointing to this panel's detail view for the current request tag. | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| <span id="method-getViewPath"></span>[`getViewPath()`](/docs/extensions/debug/reference/panel/index.md#method-getViewPath) | Returns the directory under which the panel's relative views resolve. | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| [`hasContent()`](#method-hasContent) | Returns whether the capture holds a presentation for this panel. | `ProviderPanel` |
| <span id="method-hasError"></span>[`hasError()`](/docs/extensions/debug/reference/panel/index.md#method-hasError) | Returns `true` when [`setError()`](/docs/extensions/debug/reference/panel/index.md#method-setError) captured an exception during panel capture or hydration. | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| <span id="method-hasEventHandlers"></span>[`hasEventHandlers()`](/docs/api/yii/base/component/index.md#method-hasEventHandlers) | Returns a value indicating whether there is any handler attached to the named event. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-hasMethod"></span>[`hasMethod()`](/docs/api/yii/base/component/index.md#method-hasMethod) | Returns a value indicating whether a method is defined. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-hasProperty"></span>[`hasProperty()`](/docs/api/yii/base/component/index.md#method-hasProperty) | Returns a value indicating whether a property is defined for this component. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| [`hydrate()`](#method-hydrate) | Clears any previous error and rebuilds the presentation from the captured payload. | `ProviderPanel` |
| <span id="method-init"></span>[`init()`](/docs/api/yii/base/baseobject/index.md#method-init) | Initializes the object. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-isEnabled"></span>[`isEnabled()`](/docs/extensions/debug/reference/panel/index.md#method-isEnabled) | Indicates whether this panel is enabled and should be registered by the module. | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| <span id="method-isVisible"></span>[`isVisible()`](/docs/extensions/debug/reference/panel/index.md#method-isVisible) | Returns whether the panel should appear in the toolbar and sidebar navigation. | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| [`moduleBound()`](#method-moduleBound) | Validates the configured provider as soon as the panel is bound to the module, so misconfiguration surfaces at bootstrap instead of at render time. | `ProviderPanel` |
| <span id="method-off"></span>[`off()`](/docs/api/yii/base/component/index.md#method-off) | Detaches an existing event handler from this component. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-on"></span>[`on()`](/docs/api/yii/base/component/index.md#method-on) | Attaches an event handler to an event. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| <span id="method-setError"></span>[`setError()`](/docs/extensions/debug/reference/panel/index.md#method-setError) | Records an exception thrown during capture or hydration so [`LogTarget`](/docs/extensions/debug/reference/logtarget/index.md) can surface it in the UI. | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| <span id="method-setRenderContext"></span>[`setRenderContext()`](/docs/extensions/debug/reference/panel/index.md#method-setRenderContext) | Installs the framework-neutral render context prepared for this panel by the debugger action. | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| <span id="method-trigger"></span>[`trigger()`](/docs/api/yii/base/component/index.md#method-trigger) | Triggers an event. | [`yii\base\Component`](/docs/api/yii/base/component/index.md) |
| [`getToolbarItems()`](#method-getToolbarItems) protected | Builds the toolbar metrics the provider declares for a capture. | `ProviderPanel` |

## Method details

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

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

Renders the provider's presentation of the hydrated capture.

**Returns**

`string`: Rendered detail view.

**Throws**

- [`LogicException`](https://www.php.net/manual/en/class.logicexception.php): when no capture has been hydrated.

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

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

Returns the human-readable panel name, preferring the title resolved by the registration policy.

**Returns**

`string`: Configured display title, or the one declared by the provider.

**Throws**

- [`yii\base\InvalidConfigException`](/docs/api/yii/base/invalidconfigexception/index.md): when no provider is configured, or its ID does not match the registration.

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

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

Returns the shared Debug Core icon key, preferring the one resolved by the registration policy.

**Returns**

`string`: Configured toolbar icon key, or the one declared by the provider.

**Throws**

- [`yii\base\InvalidConfigException`](/docs/api/yii/base/invalidconfigexception/index.md): when no provider is configured, or its ID does not match the registration.

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

```php
public function hasContent(): bool
```

Returns 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.

**Returns**

`bool`: `true` when the panel carries an error or a presentation built from the capture; `false` otherwise.

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

```php
public function hydrate(array<string, mixed> $payload): void
```

Clears any previous error and rebuilds the presentation from the captured payload.

**Parameters**

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

**Throws**

- [`yii\base\InvalidConfigException`](/docs/api/yii/base/invalidconfigexception/index.md): when no provider is configured, or its ID does not match the registration.

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

```php
public function moduleBound(): void
```

Validates the configured provider as soon as the panel is bound to the module, so misconfiguration
surfaces at bootstrap instead of at render time.

**Throws**

- [`yii\base\InvalidConfigException`](/docs/api/yii/base/invalidconfigexception/index.md): when no provider is configured, or its ID does not match the registration.

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

```php
protected function getToolbarItems(): array<int, array<string, mixed>>
```

Builds the toolbar metrics the provider declares for a capture.

**Returns**

`array<int, array<string, mixed>>`: Toolbar chips built from the provider's metrics, in declared order.