AssetInterface
interface AssetInterface (View source)
Interface that all the assets must implement.
Constants
ASSET_POSITION_HEADER |
Asset position: in the |
ASSET_POSITION_FOOTER |
Asset position: at the end of the |
OUTPUTASSETTYPE_CSS |
Output asset type: CSS. |
OUTPUTASSETTYPE_JAVASCRIPT |
Output asset type: JavaScript. |
OUTPUT_NOCACHE_PARAM |
QueryString parameter to avoid browser cache problems. |
Methods
Render the HTML tag that will load this asset.
Get the default asset position (\Concrete\Core\Asset\AssetInterface::ASSET_POSITION_HEADER or \Concrete\Core\Asset\AssetInterface::ASSET_POSITION_FOOTER).
Set the position of this asset (\Concrete\Core\Asset\AssetInterface::ASSET_POSITION_HEADER or \Concrete\Core\Asset\AssetInterface::ASSET_POSITION_FOOTER).
Get the position of this asset (\Concrete\Core\Asset\AssetInterface::ASSET_POSITION_HEADER or \Concrete\Core\Asset\AssetInterface::ASSET_POSITION_FOOTER).
Get the unique identifier of the asset type.
Get the handle of this asset (together with getAssetType, identifies this asset).
Get the resulting type of the asset (\Concrete\Core\Asset\AssetInterface::OUTPUTASSETTYPE_CSS, \Concrete\Core\Asset\AssetInterface::OUTPUTASSETTYPE_JAVASCRIPT or other values).
Is this asset a locally available file (accessible with the getAssetPath method)?
Is this asset a locally available file (accessible with the getAssetPath method)?
Set the URL of this asset.
Get the URL of this asset.
Set the path to this asset.
Get the path to this asset.
If the asset is local, set its path and URL starting from the relative path. If it's not local, set its URL.
Get the path of the parent "folder" that contains this asset.
Get the name of the file of this asset.
Get a string that unambiguously identifies this asset.
Set the version of this asset.
Get the version of this asset.
Get the contents of the asset (if applicable).
Set the URL of the source files this asset has been built from (useful to understand the origin of this asset).
Details
string
__toString()
Render the HTML tag that will load this asset.
string
getAssetDefaultPosition()
Get the default asset position (\Concrete\Core\Asset\AssetInterface::ASSET_POSITION_HEADER or \Concrete\Core\Asset\AssetInterface::ASSET_POSITION_FOOTER).
setAssetPosition(string $position)
Set the position of this asset (\Concrete\Core\Asset\AssetInterface::ASSET_POSITION_HEADER or \Concrete\Core\Asset\AssetInterface::ASSET_POSITION_FOOTER).
string
getAssetPosition()
Get the position of this asset (\Concrete\Core\Asset\AssetInterface::ASSET_POSITION_HEADER or \Concrete\Core\Asset\AssetInterface::ASSET_POSITION_FOOTER).
string
getAssetType()
Get the unique identifier of the asset type.
string
getAssetHandle()
Get the handle of this asset (together with getAssetType, identifies this asset).
string
getOutputAssetType()
Get the resulting type of the asset (\Concrete\Core\Asset\AssetInterface::OUTPUTASSETTYPE_CSS, \Concrete\Core\Asset\AssetInterface::OUTPUTASSETTYPE_JAVASCRIPT or other values).
setAssetIsLocal(bool $isLocal)
Is this asset a locally available file (accessible with the getAssetPath method)?
bool
isAssetLocal()
Is this asset a locally available file (accessible with the getAssetPath method)?
setAssetURL(string $url)
Set the URL of this asset.
string
getAssetURL()
Get the URL of this asset.
setAssetPath(string $path)
Set the path to this asset.
string
getAssetPath()
Get the path to this asset.
mapAssetLocation(string $path)
If the asset is local, set its path and URL starting from the relative path. If it's not local, set its URL.
string
getAssetURLPath()
Get the path of the parent "folder" that contains this asset.
string
getAssetFilename()
Get the name of the file of this asset.
string
getAssetHashKey()
Get a string that unambiguously identifies this asset.
setAssetVersion(string $version)
Set the version of this asset.
string
getAssetVersion()
Get the version of this asset.
string|null
getAssetContents()
Get the contents of the asset (if applicable).
setCombinedAssetSourceFiles(string[] $paths)
Set the URL of the source files this asset has been built from (useful to understand the origin of this asset).
register(string $filename, array $args, Package|Package|string|null|false $pkg = false)
Register the asset properties.
static AssetInterface[]
process(AssetInterface[] $assets)
Asset-type specific post-processing.