AssetCollector
API reference › Yii3 Debug › Collector › AssetCollector
Captures yiisoft/assets bundles loaded during the request for the Asset Bundles panel.
Methods
Section titled “Methods”| Method | Description | Defined 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 |
Method details
Section titled “Method details”capture()
Section titled “capture() ”public function capture(): array<string, mixed>|nullEncodes the captured bundles into the Asset Bundles panel payload.
Returns
array<string, mixed>|null: Encoded Asset panel payload; null when the collector never started.
collect()
Section titled “collect() ”public function collect(Yiisoft\Assets\AssetBundle $bundle, string $name): voidNarrows 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
| Parameter | Type | Description |
|---|---|---|
$bundle | Yiisoft\ | Bundle the loader resolved. |
$name | string | Bundle class name the loader was asked for. |
public function id(): stringReturns the stable identifier of this collector.
Returns
string: Stable ID pairing this collector with its panel.
shutdown()
Section titled “shutdown() ”public function shutdown(): voidStops capturing and clears the bundles accumulated for the request.
startup()
Section titled “startup() ”public function startup(): voidStarts capturing, discarding anything left from a previous request.