trait CombinesAssets

Properties

protected array $bundles
protected array $filters
protected string $storagePath
bool $cacheKeyPrefix
bool $useCache
protected $assetsCombinerUri
protected $combineAssets

Methods

initCombiner()

No description

string
combine(string $type, array $assets = [])

Combines JavaScript or StyleSheet file references to produce a page relative URL to the combined contents.

void
combineToFile(array $assets, string $destination)

Combines a collection of assets files to a destination file

combineGetContents($cacheKey)

No description

prepareAssets(array $assets)

No description

prepareCombiner(array $assets, $targetPath = null)

No description

string
getCombinerPath(string|null $path = null)

Returns the target path used with the combiner.

applyCacheOnFiles($files)

No description

registerFilter(string|array $extension, object $filter)

Register a filter to apply to the combining process.

void
registerBundle($extension, $files, null $destination = null, string $appContext = 'main')

Registers bundle.

array
getBundles(string $extension = null, string $appContext = 'main')

Returns bundles.

array
getFilters(string $extension = null)

Returns filters.

resetFilters(string $extension = null)

Clears any registered filters.

getCacheKey(array $assets)

No description

getCache($cacheKey)

No description

putCache($cacheKey, $cacheData)

No description

Details

at line 50
protected initCombiner()

No description

at line 86
string combine(string $type, array $assets = [])

Combines JavaScript or StyleSheet file references to produce a page relative URL to the combined contents.

$assets = [ 'assets/css/vendor/animate.css', 'assets/css/vendor/dropzone.css', 'assets/css/vendor/select2.min.css', ];

Assets::combine('css', $assets);

Parameters

string $type
array $assets

Collection of assets

Return Value

string

URL to contents.

at line 129
void combineToFile(array $assets, string $destination)

Combines a collection of assets files to a destination file

$assets = [ 'assets/scss/flame.scss', 'assets/scss/main.scss', ];

CombineAssets::combineToFile( $assets, base_path('themes/demo/assets/css/theme.css'), );

Parameters

array $assets

Collection of assets

string $destination

Write the combined file to this location

Return Value

void

at line 142
combineGetContents($cacheKey)

No description

Parameters

$cacheKey

at line 172
protected prepareAssets(array $assets)

No description

Parameters

array $assets

at line 181
protected prepareCombiner(array $assets, $targetPath = null)

No description

Parameters

array $assets
$targetPath

at line 227
protected string getCombinerPath(string|null $path = null)

Returns the target path used with the combiner.

/index.php/_assets returns index-php/_assets/

Parameters

string|null $path

Return Value

string

The new target path

at line 240
protected applyCacheOnFiles($files)

No description

Parameters

$files

at line 272
CombinesAssets registerFilter(string|array $extension, object $filter)

Register a filter to apply to the combining process.

Parameters

string|array $extension

Extension name. Eg: css

object $filter

Collection of files to combine.

Return Value

CombinesAssets

at line 305
void registerBundle($extension, $files, null $destination = null, string $appContext = 'main')

Registers bundle.

Parameters

$extension
$files
null $destination
string $appContext

Return Value

void

at line 341
array getBundles(string $extension = null, string $appContext = 'main')

Returns bundles.

Parameters

string $extension
string $appContext

Return Value

array

at line 359
array getFilters(string $extension = null)

Returns filters.

Parameters

string $extension

Return Value

array

at line 377
CombinesAssets resetFilters(string $extension = null)

Clears any registered filters.

Parameters

string $extension

Return Value

CombinesAssets

at line 393
protected getCacheKey(array $assets)

No description

Parameters

array $assets

at line 400
protected getCache($cacheKey)

No description

Parameters

$cacheKey

at line 409
protected putCache($cacheKey, $cacheData)

No description

Parameters

$cacheKey
$cacheData