WebAssetManagerInterface

Web Asset Manager Interface

since

4.0.0

Methods

disableAsset

Deactivate an asset item, so it will not be attached to a Document

disableAsset(string $type, string $name) : self
throws

\Joomla\CMS\WebAsset\Exception\UnknownAssetExceptionWhen Asset cannot be found

\Joomla\CMS\WebAsset\Exception\InvalidActionExceptionWhen the Manager already attached to a Document

since

4.0.0

Arguments

$type

stringAsset type, script or style etc

$name

stringThe asset name

Response

self

getAssets

Get all assets that was enabled for given type

getAssets(string $type, boolean $sort = false) : array<mixed,\Joomla\CMS\WebAsset\WebAssetItemInterface>
throws

\Joomla\CMS\WebAsset\Exception\UnknownAssetExceptionWhen Asset cannot be found

\Joomla\CMS\WebAsset\Exception\UnsatisfiedDependencyExceptionWhen Dependency cannot be found

since

4.0.0

Arguments

$type

stringAsset type, script or style etc

$sort

booleanWhether need to sort the assets to follow the dependency Graph

Response

array<mixed,\Joomla\CMS\WebAsset\WebAssetItemInterface>

isAssetActive

Check whether the asset are enabled

isAssetActive(string $type, string $name) : boolean
throws

\Joomla\CMS\WebAsset\Exception\UnknownAssetExceptionWhen Asset cannot be found

since

4.0.0

Arguments

$type

stringAsset type, script or style etc

$name

stringThe asset name

Response

boolean

useAsset

Enable an asset item to be attached to a Document

useAsset(string $type, string $name) : self
throws

\Joomla\CMS\WebAsset\Exception\UnknownAssetExceptionWhen Asset cannot be found

\Joomla\CMS\WebAsset\Exception\InvalidActionExceptionWhen the Manager already attached to a Document

since

4.0.0

Arguments

$type

stringAsset type, script or style etc

$name

stringThe asset name

Response

self