Interface Yiisoft\Assets\AssetLoaderInterface
| Implemented by | Yiisoft\Assets\AssetLoader, Yiisoft\Assets\Debug\AssetLoaderInterfaceProxy |
|---|
The AssetLoaderInterface must be implemented by asset loader classes. The job of such class is executing the loading
of the assets from {@see AssetBundle::$basePath} to {@see AssetBundle::$baseUrl}.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| getAssetUrl() | Returns the actual URL for the specified asset. | Yiisoft\Assets\AssetLoaderInterface |
| loadBundle() | Loads an asset bundle class by name or creates an instance of the asset bundle class, if class name not exists. | Yiisoft\Assets\AssetLoaderInterface |
Method Details
Returns the actual URL for the specified asset.
The actual URL is obtained by prepending {@see \Yiisoft\Assets\AssetBundle::$baseUrl} to the given asset path.
| public abstract string getAssetUrl ( Yiisoft\Assets\AssetBundle $bundle, string $assetPath ) | ||
| $bundle | Yiisoft\Assets\AssetBundle |
The asset bundle which the asset file belongs to. |
| $assetPath | string |
The asset path. See {@see \Yiisoft\Assets\AssetBundle::$js} and {@see \Yiisoft\Assets\AssetBundle::$css}. |
| return | string |
The actual URL for the specified asset. |
|---|---|---|
| throws | Yiisoft\Assets\Exception\InvalidConfigException |
If asset files are not found. |
public function getAssetUrl(AssetBundle $bundle, string $assetPath): string;
Loads an asset bundle class by name or creates an instance of the asset bundle class, if class name not exists.
| public abstract Yiisoft\Assets\AssetBundle loadBundle ( string $name, array $config = [] ) | ||
| $name | string |
The asset bundle name. |
| $config | array |
The asset bundle instance configuration. |
| return | Yiisoft\Assets\AssetBundle |
The asset bundle instance. |
|---|---|---|
| throws | Yiisoft\Assets\Exception\InvalidConfigException |
For invalid asset bundle configuration. |
public function loadBundle(string $name, array $config = []): AssetBundle;
Signup or Login in order to comment.