Asset
This singleton class stores the manifest.json file and provides methods to retrieve the assets.
Overview
Methods
| Name | Return Type | Summary/Returns |
|---|---|---|
| __toString() | false or string | Magic 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() | object | Get asset by key. |
| get_manifest() | array | Get the manifest file. |
| json() | array or false | Get the contents of the asset as JSON. |
| path() | Get the path to the asset. | |
| uri() | false or string | Get 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
| Name | Type | Description |
|---|---|---|
| $key | string | key 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
| Name | Type | Description |
|---|---|---|
| $assoc | bool | whether to return an associative array |
path()
Get the path to the asset.
uri()
Get the uri to the asset.
Returns: false|string