Since: 4.0.0

interface WebAssetManagerInterface

Web Asset Manager Interface

Methods

useAsset(string $type, string $name)

Enable an asset item to be attached to a Document

disableAsset(string $type, string $name)

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

bool
isAssetActive(string $type, string $name)

Check whether the asset are enabled

array
getAssets(string $type, bool $sort = false)

Get all assets that was enabled for given type

Details

WebAssetManagerInterface useAsset(string $type, string $name)

Since: 4.0.0

Enable an asset item to be attached to a Document

Parameters

string $type

Asset type, script or style etc

string $name

The asset name

Return Value

WebAssetManagerInterface

Exceptions

UnknownAssetException
InvalidActionException

WebAssetManagerInterface disableAsset(string $type, string $name)

Since: 4.0.0

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

Parameters

string $type

Asset type, script or style etc

string $name

The asset name

Return Value

WebAssetManagerInterface

Exceptions

UnknownAssetException
InvalidActionException

bool isAssetActive(string $type, string $name)

Since: 4.0.0

Check whether the asset are enabled

Parameters

string $type

Asset type, script or style etc

string $name

The asset name

Return Value

bool

Exceptions

UnknownAssetException

array getAssets(string $type, bool $sort = false)

Since: 4.0.0

Get all assets that was enabled for given type

Parameters

string $type

Asset type, script or style etc

bool $sort

Whether need to sort the assets to follow the dependency Graph

Return Value

array

Exceptions

UnknownAssetException
UnsatisfiedDependencyException