class JavascriptAsset 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 bool $assetSupportsMinification
protected bool $assetSupportsCombination
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

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

from  Asset
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(bool $minify)

Does this asset support minification?

from  Asset
bool
assetSupportsMinification()

Does this asset support minification?

from  Asset
setAssetSupportsCombination(bool $combine)

Can this asset be combined with other assets?

from  Asset
bool
assetSupportsCombination()

Can this asset be combined with other assets?

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.

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

No description

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
getAssetDefaultPosition()

No description

static string
getRelativeOutputDirectory()

No description

static bool|string
getOutputDirectory()

No description

string
getAssetType()

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

See also

AssetInterface::getOutputAssetType

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(bool $minify)

Does this asset support minification?

Parameters

bool $minify

See also

AssetInterface::setAssetSupportsMinification

bool assetSupportsMinification()

Does this asset support minification?

Return Value

bool

See also

AssetInterface::assetSupportsMinification

setAssetSupportsCombination(bool $combine)

Can this asset be combined with other assets?

Parameters

bool $combine

See also

AssetInterface::setAssetSupportsCombination

bool assetSupportsCombination()

Can this asset be combined with other assets?

Return Value

bool

See also

AssetInterface::assetSupportsCombination

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)

See also

AssetInterface::register

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

No description

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 getAssetDefaultPosition()

No description

Return Value

string

static string getRelativeOutputDirectory()

No description

Return Value

string

static protected bool|string getOutputDirectory()

No description

Return Value

bool|string

string getAssetType()

No description

Return Value

string

string __toString()

No description

Return Value

string