Skip to content
PHP Ecosystem
Explore

AssetCollector

API reference › Yii3 Debug › Collector › AssetCollector

final classYii3\Debug\Collector\AssetCollector
ImplementsCollectorInterface
Sourcesrc/Collector/AssetCollector.php

Captures yiisoft/assets bundles loaded during the request for the Asset Bundles panel.

MethodDescriptionDefined by
capture()Encodes the captured bundles into the Asset Bundles panel payload.AssetCollector
collect()Narrows one loaded bundle into a typed row, keyed by class name so a repeated load never duplicates it.AssetCollector
id()Returns the stable identifier of this collector.AssetCollector
shutdown()Stops capturing and clears the bundles accumulated for the request.AssetCollector
startup()Starts capturing, discarding anything left from a previous request.AssetCollector
public function capture(): array<string, mixed>|null

Encodes the captured bundles into the Asset Bundles panel payload.

Returns

array<string, mixed>|null: Encoded Asset panel payload; null when the collector never started.

public function collect(Yiisoft\Assets\AssetBundle $bundle, string $name): void

Narrows one loaded bundle into a typed row, keyed by class name so a repeated load never duplicates it.

The debugger’s own toolbar bundle is excluded because it is infrastructure rather than application content.

Parameters

ParameterTypeDescription
$bundleYiisoft\Assets\AssetBundleBundle the loader resolved.
$namestringBundle class name the loader was asked for.
public function id(): string

Returns the stable identifier of this collector.

Returns

string: Stable ID pairing this collector with its panel.

public function shutdown(): void

Stops capturing and clears the bundles accumulated for the request.

public function startup(): void

Starts capturing, discarding anything left from a previous request.