\BrickrougeAssetsCollector

Root class for documents assets collectors.

Summary

Methods
Properties
Constants
__construct()
add()
get()
clear()
cache_construct()
$use_cache
No constants found
No protected methods found
$collected
N/A
No private methods found
No private properties found
N/A

Properties

$use_cache

$use_cache : boolean

Whether the collected assets should be cached.

Type

boolean

$collected

$collected : array

Collected assets

Type

array

Methods

__construct()

__construct(boolean  $use_cache = false) 

Sets the cache policy according to the configuration.

Parameters

boolean $use_cache

add()

add(string  $path, integer  $weight, string|null  $root = null) : \Brickrouge\AssetsCollector

Adds an asset to the collection.

Parameters

string $path

Path, or relative path to the asset.

integer $weight

Weight of the asset in the collection.

string|null $root

Root used to resolve the asset path into a URL.

Returns

\Brickrouge\AssetsCollector

Return the object itself for chainable calls.

get()

get() : array

Returns the collected assets as an array of URL.

Returns

array

clear()

clear() 

Clears the collected assets.

cache_construct()

cache_construct(\ICanBoogie\FileCache  $cache, string  $key, array  $userdata) : mixed

Construct cache entry.

Parameters

\ICanBoogie\FileCache $cache
string $key
array $userdata

Returns

mixed