WebAssetManagerInterface

Web Asset Manager Interface

since

4.0.0

package

Joomla CMS

Methods

disableAsset

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

disableAsset( type,  name) : 
throws

UnknownAssetExceptionWhen Asset cannot be found

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( type,  sort = false) : \Joomla\CMS\WebAsset\WebAssetItemInterface||string|int
throws

UnknownAssetExceptionWhen Asset cannot be found

UnsatisfiedDependencyExceptionWhen Dependency cannot be found

since

4.0.0

Arguments

type

stringAsset type, script or style etc

sort

boolWhether need to sort the assets to follow the dependency Graph

Response

array<string|int, WebAssetItemInterface>

isAssetActive

Check whether the asset are enabled

isAssetActive( type,  name) : 
throws

UnknownAssetExceptionWhen Asset cannot be found

since

4.0.0

Arguments

type

stringAsset type, script or style etc

name

stringThe asset name

Response

bool

useAsset

Enable an asset item to be attached to a Document

useAsset( type,  name) : 
throws

UnknownAssetExceptionWhen Asset cannot be found

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