WebAssetManagerInterface

Web Asset Manager Interface

since

4.0.0

package

Application

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, bool sort = false) : \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

boolWhether need to sort the assets to follow the dependency Graph

Response

\Joomla\CMS\WebAsset\WebAssetItemInterface[]

isAssetActive

Check whether the asset are enabled

isAssetActive(string type, string name) : bool
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

bool

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