class JavascriptConditionalAsset 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 $conditional

Methods

__construct(string $assetHandle = '')

Initialize the instance.

from  Asset
setAssetPosition(string $position)

Set the position of this asset (\Concrete\Core\Asset\AssetInterface::ASSET_POSITION_HEADER or \Concrete\Core\Asset\AssetInterface::ASSET_POSITION_FOOTER).

from  Asset
string
getAssetPosition()

Get the position of this asset (\Concrete\Core\Asset\AssetInterface::ASSET_POSITION_HEADER or \Concrete\Core\Asset\AssetInterface::ASSET_POSITION_FOOTER).

from  Asset
string
getAssetHandle()

Get the handle of this asset (together with getAssetType, identifies this asset).

from  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)?

from  Asset
bool
isAssetLocal()

Is this asset a locally available file (accessible with the getAssetPath method)?

from  Asset
setAssetSupportsMinification($minify)

No description

from  Asset
assetSupportsMinification()

No description

from  Asset
setAssetSupportsCombination($combine)

No description

from  Asset
assetSupportsCombination()

No description

from  Asset
setAssetLocation(string $location)

Set the location of this asset.

from  Asset
setAssetURL(string $url)

Set the URL of this asset.

from  Asset
string
getAssetURL()

Get the URL of this asset.

from  Asset
setAssetPath(string $path)

Set the path to this asset.

from  Asset
string
getAssetPath()

Get the path to this asset.

from  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.

from  Asset
bool
hasAssetBeenMapped()

Does the URL/path have already been resolved (starting from the location) for this (local) assets?

from  Asset
string
getAssetURLPath()

Get the path of the parent "folder" that contains this asset.

from  Asset
string
getAssetFilename()

Get the name of the file of this asset.

from  Asset
string
getAssetHashKey()

Get a string that unambiguously identifies this asset.

from  Asset
setAssetVersion(string $version)

Set the version of this asset.

from  Asset
string
getAssetVersion()

Get the version of this asset.

from  Asset
setPackageObject(Package|Package|null|false $pkg)

Set the package that defines this asset.

from  Asset
string|null
getAssetContents()

Get the contents of the asset (if applicable).

from  Asset
setCombinedAssetSourceFiles(string[] $paths)

Set the URL of the source files this asset has been built from (useful to understand the origin of this asset).

from  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.

getAssetPointer()

Get an AssetPointer instance that identifies this asset.

from  Asset
static string|null
getAssetContentsByRoute(string $route)

Get the contents of an asset given its route.

from  Asset
string
obfuscateNoCacheValue(string $noCacheValue)

Obfuscate the value of the query-string parameter used to avoid browser cache problems.

from  Asset
string
getAssetType()

No description

string
getAssetDefaultPosition()

No description

string
__toString()

No description

Details

__construct(string $assetHandle = '')

Initialize the instance.

Parameters

string $assetHandle

the handle of this asset (together with getAssetType, identifies this asset)

setAssetPosition(string $position)

Set the position of this asset (\Concrete\Core\Asset\AssetInterface::ASSET_POSITION_HEADER or \Concrete\Core\Asset\AssetInterface::ASSET_POSITION_FOOTER).

Parameters

string $position

See also

AssetInterface::setAssetPosition

string getAssetPosition()

Get the position of this asset (\Concrete\Core\Asset\AssetInterface::ASSET_POSITION_HEADER or \Concrete\Core\Asset\AssetInterface::ASSET_POSITION_FOOTER).

Return Value

string

See also

AssetInterface::getAssetPosition

string getAssetHandle()

Get the handle of this asset (together with getAssetType, identifies this asset).

Return Value

string

See also

AssetInterface::getAssetHandle

string getOutputAssetType()

Get the resulting type of the asset (\Concrete\Core\Asset\AssetInterface::OUTPUTASSETTYPE_CSS, \Concrete\Core\Asset\AssetInterface::OUTPUTASSETTYPE_JAVASCRIPT or other values).

Return Value

string

setAssetIsLocal(bool $isLocal)

Is this asset a locally available file (accessible with the getAssetPath method)?

Parameters

bool $isLocal

See also

AssetInterface::setAssetIsLocal

bool isAssetLocal()

Is this asset a locally available file (accessible with the getAssetPath method)?

Return Value

bool

See also

AssetInterface::isAssetLocal

setAssetSupportsMinification($minify)

No description

Parameters

$minify

assetSupportsMinification()

No description

setAssetSupportsCombination($combine)

No description

Parameters

$combine

assetSupportsCombination()

No description

setAssetLocation(string $location)

Set the location of this asset.

Parameters

string $location

setAssetURL(string $url)

Set the URL of this asset.

Parameters

string $url

See also

AssetInterface::setAssetURL

string getAssetURL()

Get the URL of this asset.

Return Value

string

See also

AssetInterface::getAssetURL

setAssetPath(string $path)

Set the path to this asset.

Parameters

string $path

See also

AssetInterface::setAssetPath

string getAssetPath()

Get the path to this asset.

Return Value

string

See also

AssetInterface::getAssetPath

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.

Parameters

string $path

See also

AssetInterface::mapAssetLocation

bool hasAssetBeenMapped()

Does the URL/path have already been resolved (starting from the location) for this (local) assets?

Return Value

bool

string getAssetURLPath()

Get the path of the parent "folder" that contains this asset.

Return Value

string

See also

AssetInterface::getAssetURLPath

string getAssetFilename()

Get the name of the file of this asset.

Return Value

string

See also

AssetInterface::getAssetFilename

string getAssetHashKey()

Get a string that unambiguously identifies this asset.

Return Value

string

See also

AssetInterface::getAssetHashKey

setAssetVersion(string $version)

Set the version of this asset.

Parameters

string $version

See also

AssetInterface::setAssetVersion

string getAssetVersion()

Get the version of this asset.

Return Value

string

See also

AssetInterface::getAssetVersion

setPackageObject(Package|Package|null|false $pkg)

Set the package that defines this asset.

Parameters

Package|Package|null|false $pkg

See also

AssetInterface::setPackageObject

string|null getAssetContents()

Get the contents of the asset (if applicable).

Return Value

string|null

See also

AssetInterface::getAssetContents

setCombinedAssetSourceFiles(string[] $paths)

Set the URL of the source files this asset has been built from (useful to understand the origin of this asset).

Parameters

string[] $paths

See also

AssetInterface::setCombinedAssetSourceFiles

register(string $filename, array $args, Package|Package|string|null|false $pkg = false)

Register the asset properties.

Parameters

string $filename

the location of the asset

array $args

{

@var bool $local is this asset a locally available file (accessible with the getAssetPath method)?
@var bool $minify does this asset support minification?
@var bool $combine can this asset be combined with other assets?
@var string $version the version of this asset
@var string $position the position of this asset (\Concrete\Core\Asset\AssetInterface::ASSET_POSITION_HEADER or \Concrete\Core\Asset\AssetInterface::ASSET_POSITION_FOOTER).

}

Package|Package|string|null|false $pkg

the package that defines this asset (or its handle)

static AssetInterface[] process(AssetInterface[] $assets)

Asset-type specific post-processing.

Parameters

AssetInterface[] $assets

The original assets

Return Value

AssetInterface[]

The final assets

AssetPointer getAssetPointer()

Get an AssetPointer instance that identifies this asset.

Return Value

AssetPointer

static protected string|null getAssetContentsByRoute(string $route)

Get the contents of an asset given its route.

Parameters

string $route

Return Value

string|null

protected string obfuscateNoCacheValue(string $noCacheValue)

Obfuscate the value of the query-string parameter used to avoid browser cache problems.

Parameters

string $noCacheValue

Return Value

string

string getAssetType()

No description

Return Value

string

string getAssetDefaultPosition()

No description

Return Value

string

string __toString()

No description

Return Value

string