WebAssetItemInterface

Web Asset Item interface

Asset Item are "read only" object, all properties must be set through class constructor. Only properties allowed to be edited is an attributes and an options. Changing an uri or a dependencies are not allowed, prefer to create a new asset instance.

since

4.0.0

Methods

getAttribute

Get the attribute

getAttribute(string $key, string $default = null) : mixed
since

4.0.0

Arguments

$key

stringAn attributes key

$default

stringA default value

Response

mixed

getAttributes

Get all attributes

getAttributes() : array
since

4.0.0

Response

array

getDependencies

Return dependencies list

getDependencies() : array
since

4.0.0

Response

array

getName

Return Asset name

getName() : string
since

4.0.0

Response

string

getOption

Get the option

getOption(string $key, string $default = null) : mixed
since

4.0.0

Arguments

$key

stringAn option key

$default

stringA default value

Response

mixed

getOptions

Get all options of the asset

getOptions() : array
since

4.0.0

Response

array

getUri

Get the URI of the asset

getUri(boolean $resolvePath = true) : string
since

4.0.0

Arguments

$resolvePath

booleanWhether need to search for a real paths

Response

string

getVersion

Return Asset version

getVersion() : string
since

4.0.0

Response

string

setAttribute

Set the attribute

setAttribute(string $key, string $value = null) : self
since

4.0.0

Arguments

$key

stringAn attribute key

$value

stringAn attribute value

Response

self

setOption

Set the option

setOption(string $key, string $value = null) : self
since

4.0.0

Arguments

$key

stringAn option key

$value

stringAn option value

Response

self