AssetLoaderProxy
API reference › Yii3 Debug › Collector › AssetLoaderProxy
Intercepts AssetLoaderInterface::loadBundle() to feed the loaded bundle to the AssetCollector.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates a transparent asset-loader proxy that records each loaded bundle. | AssetLoaderProxy |
getAssetUrl() | Returns the asset URL the application loader resolves. | AssetLoaderProxy |
loadBundle() | Records the bundle the application loader resolved, then returns it unchanged. | AssetLoaderProxy |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(Yiisoft\Assets\AssetLoaderInterface $loader, Yii3\Debug\Collector\AssetCollector $collector)Creates a transparent asset-loader proxy that records each loaded bundle.
Parameters
| Parameter | Type | Description |
|---|---|---|
$loader | Yiisoft\ | Application loader every call is delegated to. |
$collector | AssetCollector | Collector recording the bundles the application loads. |
getAssetUrl()
Section titled “getAssetUrl() ”public function getAssetUrl(Yiisoft\Assets\AssetBundle $bundle, string $assetPath): stringReturns the asset URL the application loader resolves.
Parameters
| Parameter | Type | Description |
|---|---|---|
$bundle | Yiisoft\ | Bundle the asset file belongs to. |
$assetPath | string | Asset path declared by the bundle. |
Returns
string: Actual URL of the asset.
loadBundle()
Section titled “loadBundle() ”public function loadBundle(string $name, array $config = []): Yiisoft\Assets\AssetBundleRecords the bundle the application loader resolved, then returns it unchanged.
Parameters
| Parameter | Type | Description |
|---|---|---|
$name | string | Bundle class name to load. |
$config | array | Bundle instance configuration. |
Returns
Yiisoft\Assets\AssetBundle: Bundle as returned by the application loader.