AppAssetsInterface
in
The app assets interface enforces a pattern in which applications must be able to locate an asset for their operation, and they must be able to list all the assets they need to operate.
This way, Spitfire will be able to copy the assets to the deployment location so they are properly compressed and available from the webroot.
This component is only used during initialization of the app, once the assets are deployed, spitfire will no longer need this asset. It is therefore considered good practice to instantiate this inside the app's assets() method.
Tags
Table of Contents
- all() : Collection
- This must provide a full list of relative paths to the assets that the app whishes to use once deployed. Assets are not allowed to be any run-time executable files (like php files), they will be processed by Spitfire.
- map() : string
- Maps an asset to a file on disk. Passing the asset name as an argument should return a string with the location on disk of the asset.
Methods
all()
This must provide a full list of relative paths to the assets that the app whishes to use once deployed. Assets are not allowed to be any run-time executable files (like php files), they will be processed by Spitfire.
public
all() : Collection
Return values
Collection —map()
Maps an asset to a file on disk. Passing the asset name as an argument should return a string with the location on disk of the asset.
public
map(string $asset) : string
Please note that an asset name may look anything like "js/my.js" (including relative paths and file extensions).
Parameters
- $asset : string