CssAsset
class CssAsset extends Asset (View source)
Properties
protected string | $assetHandle | The handle of this asset (together with getAssetType, identifies this asset). |
from Asset |
protected string | $position | The position of this asset (\Concrete\Core\Asset\AssetInterface::ASSET_POSITION_HEADER or \Concrete\Core\Asset\AssetInterface::ASSET_POSITION_FOOTER). |
from Asset |
protected bool | $local | Is this asset a locally available file (accessible with the getAssetPath method)? |
from Asset |
protected string | $location | The location of the asset (used to build the path & URL). |
from Asset |
protected string | $assetURL | The URL of this asset. |
from Asset |
protected string | $assetPath | The path to this asset. |
from Asset |
protected bool | $assetHasBeenMapped | Does the URL/path have already been resolved (starting from the location) for this (local) assets? |
from Asset |
protected string | $filename | The name of the file of this asset. |
from Asset |
protected string | $assetVersion | The asset version. |
from Asset |
protected Package|Package|null | $pkg | The package that defines this asset. |
from Asset |
protected array | $combinedAssetSourceFiles | The URL of the source files this asset has been built from (useful to understand the origin of this asset). |
from Asset |
protected string | $assetMedia | The default media of this asset. |
Methods
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 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)?
If the asset is local, set its path and URL starting from the relative path. If it's not local, set its URL.
Does the URL/path have already been resolved (starting from the location) for this (local) assets?
Set the URL of the source files this asset has been built from (useful to understand the origin of this asset).
Get the contents of an asset given its route.
Obfuscate the value of the query-string parameter used to avoid browser cache problems.
No description
No description
Set the media of this asset.
Get the media of this asset.
No description
No description
No description
No description
Details
in
Asset at line 99
__construct(string $assetHandle = '')
Initialize the instance.
in
Asset at line 110
setAssetPosition(string $position)
Set the position of this asset (\Concrete\Core\Asset\AssetInterface::ASSET_POSITION_HEADER or \Concrete\Core\Asset\AssetInterface::ASSET_POSITION_FOOTER).
in
Asset at line 120
string
getAssetPosition()
Get the position of this asset (\Concrete\Core\Asset\AssetInterface::ASSET_POSITION_HEADER or \Concrete\Core\Asset\AssetInterface::ASSET_POSITION_FOOTER).
in
Asset at line 130
string
getAssetHandle()
Get the handle of this asset (together with getAssetType, identifies this asset).
in
Asset at line 140
string
getOutputAssetType()
Get the resulting type of the asset (\Concrete\Core\Asset\AssetInterface::OUTPUTASSETTYPE_CSS, \Concrete\Core\Asset\AssetInterface::OUTPUTASSETTYPE_JAVASCRIPT or other values).
in
Asset at line 150
setAssetIsLocal(bool $isLocal)
Is this asset a locally available file (accessible with the getAssetPath method)?
in
Asset at line 160
bool
isAssetLocal()
Is this asset a locally available file (accessible with the getAssetPath method)?
in
Asset at line 168
setAssetSupportsMinification($minify)
No description
in
Asset at line 176
assetSupportsMinification()
No description
in
Asset at line 184
setAssetSupportsCombination($combine)
No description
in
Asset at line 192
assetSupportsCombination()
No description
in
Asset at line 202
setAssetLocation(string $location)
Set the location of this asset.
in
Asset at line 212
setAssetURL(string $url)
Set the URL of this asset.
in
Asset at line 223
string
getAssetURL()
Get the URL of this asset.
in
Asset at line 251
setAssetPath(string $path)
Set the path to this asset.
in
Asset at line 262
string
getAssetPath()
Get the path to this asset.
in
Asset at line 276
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.
in
Asset at line 297
bool
hasAssetBeenMapped()
Does the URL/path have already been resolved (starting from the location) for this (local) assets?
in
Asset at line 307
string
getAssetURLPath()
Get the path of the parent "folder" that contains this asset.
in
Asset at line 317
string
getAssetFilename()
Get the name of the file of this asset.
in
Asset at line 327
string
getAssetHashKey()
Get a string that unambiguously identifies this asset.
in
Asset at line 363
setAssetVersion(string $version)
Set the version of this asset.
in
Asset at line 373
string
getAssetVersion()
Get the version of this asset.
in
Asset at line 383
setPackageObject(Package|Package|null|false $pkg)
Set the package that defines this asset.
in
Asset at line 393
string|null
getAssetContents()
Get the contents of the asset (if applicable).
in
Asset at line 405
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)
No description
in
Asset at line 456
AssetPointer
getAssetPointer()
Get an AssetPointer instance that identifies this asset.
in
Asset at line 470
static protected string|null
getAssetContentsByRoute(string $route)
Get the contents of an asset given its route.
in
Asset at line 522
protected string
obfuscateNoCacheValue(string $noCacheValue)
Obfuscate the value of the query-string parameter used to avoid browser cache problems.
string
getAssetDefaultPosition()
No description
string
getAssetType()
No description
setAssetMedia(string $assetMedia)
Set the media of this asset.
string
getAssetMedia()
Get the media of this asset.
static protected string
getRelativeOutputDirectory()
No description
static protected bool|string
getOutputDirectory()
No description
static string
changePaths(string $content, string $current_path, string $target_path)
No description
string
__toString()
No description