Skip to main content

Asset

This singleton class stores the manifest.json file and provides methods to retrieve the assets.

Overview​

Methods​

NameReturn TypeSummary/Returns
__toString()false or stringMagic method to get the uri of the asset when the object is cast to a string.
contents()Get the contents of the asset.
exists()Check if the asset exists.
get_key()objectGet asset by key.
get_manifest()arrayGet the manifest file.
json()array or falseGet the contents of the asset as JSON.
path()Get the path to the asset.
uri()false or stringGet the uri to the asset.

Class Methods​

__toString()​

Magic method to get the uri of the asset when the object is cast to a string.

Returns: false|string


contents()​

Get the contents of the asset.


exists()​

Check if the asset exists.


get_key()​

Get asset by key.

get_key( string $key )

Returns: object

NameTypeDescription
$keystringkey of the asset

get_manifest()​

Get the manifest file.

Returns: array


json()​

Get the contents of the asset as JSON.

json( bool $assoc = true )

Returns: array|false

NameTypeDescription
$assocboolwhether to return an associative array

path()​

Get the path to the asset.


uri()​

Get the uri to the asset.

Returns: false|string