# AssetPanel

> Renders the asset bundles captured by the Asset Bundles collector.

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

| class | `yii\debug\panels\AssetPanel` |
| --- | --- |
| 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/AssetPanel.php`](https://github.com/yii2-extensions/debug/blob/main/src/panels/AssetPanel.php#L25) |

Renders the asset bundles captured by the Asset Bundles collector.

Delegates the detail view to the framework-neutral [`AssetPanel`](https://github.com/php-forge/debug-core/blob/b70459f033a1d7a1c5edf7951029aad2061986dd/src/Panel/Asset/AssetPanel.php); data acquisition lives in
[`AssetCollector`](/docs/extensions/debug/reference/collectors/assetcollector/index.md).

## 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 panel markup. | `AssetPanel` |
| <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` | Panel display name. | `AssetPanel` |
| <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-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` | Toolbar icon key. | `AssetPanel` |
| <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 detail view through the shared declarative presenter. | `AssetPanel` |
| <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 panel display name from the shared title enum. | `AssetPanel` |
| <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 icon key from the shared panel icon enum. | `AssetPanel` |
| <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 loaded capture contains asset bundles or embedded Vite data. | `AssetPanel` |
| <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) | Decodes the captured payload into the typed asset-bundle snapshot backing this panel. | `AssetPanel` |
| <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) |
| [`isEnabled()`](#method-isEnabled) | Returns whether the application exposes an `assetManager` component the panel can read. | `AssetPanel` |
| <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) |
| <span id="method-moduleBound"></span>[`moduleBound()`](/docs/extensions/debug/reference/panel/index.md#method-moduleBound) | Completes module-dependent wiring after the container module binds [`$id`](/docs/extensions/debug/reference/panel/index.md#property-id) and [`$module`](/docs/extensions/debug/reference/panel/index.md#property-module). | [`yii\debug\Panel`](/docs/extensions/debug/reference/panel/index.md) |
| <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 | Returns the toolbar item showing the count of registered bundles, or `[]` when none were captured. | `AssetPanel` |

## Method details

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

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

Renders the detail view through the shared declarative presenter.

**Returns**

`string`: Rendered panel markup.

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

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

Returns the panel display name from the shared title enum.

**Returns**

`string`: Panel display name.

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

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

Returns the icon key from the shared panel icon enum.

**Returns**

`string`: Toolbar icon key.

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

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

Returns whether the loaded capture contains asset bundles or embedded Vite data.

**Returns**

`bool`: `true` when the capture holds at least one bundle; `false` otherwise.

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

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

Decodes the captured payload into the typed asset-bundle snapshot backing this panel.

**Parameters**

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

**Throws**

- `PHPForge\Debug\Storage\HydrationException`: when the payload does not match the snapshot schema.

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

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

Returns whether the application exposes an `assetManager` component the panel can read.

**Returns**

`bool`: `true` when the panel may capture and render; `false` otherwise.

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

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

Returns the toolbar item showing the count of registered bundles, or `[]` when none were captured.

**Returns**

`array<int, array<string, mixed>>`: Single-element list with the `info` chip, or `[]`.