Documentation

AssetManager
in package

Manages assets.

Tags
author

Kris Wallsmith kris.wallsmith@gmail.com

Table of Contents

$assets  : mixed
clear()  : mixed
Clears all assets.
get()  : AssetInterface
Gets an asset by name.
getNames()  : array<string|int, mixed>
Returns an array of asset names.
has()  : bool
Checks if the current asset manager has a certain asset.
set()  : mixed
Registers an asset to the current asset manager.

Properties

Methods

clear()

Clears all assets.

public clear() : mixed
Return values
mixed

get()

Gets an asset by name.

public get(string $name) : AssetInterface
Parameters
$name : string

The asset name

Tags
throws
InvalidArgumentException

If there is no asset by that name

Return values
AssetInterface

The asset

getNames()

Returns an array of asset names.

public getNames() : array<string|int, mixed>
Return values
array<string|int, mixed>

An array of asset names

has()

Checks if the current asset manager has a certain asset.

public has(string $name) : bool
Parameters
$name : string

an asset name

Return values
bool

True if the asset has been set, false if not

set()

Registers an asset to the current asset manager.

public set(string $name, AssetInterface $asset) : mixed
Parameters
$name : string

The asset name

$asset : AssetInterface

The asset

Tags
throws
InvalidArgumentException

If the asset name is invalid

Return values
mixed

Search results