trait CombinesAssets

Properties

protected array $bundles
protected array $filters
protected string $storagePath
bool $cacheKeyPrefix
bool $useCache
bool $useMinify
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 55
protected initCombiner()

No description

at line 100
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 143
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 156
combineGetContents($cacheKey)

No description

Parameters

$cacheKey

at line 186
protected prepareAssets(array $assets)

No description

Parameters

array $assets

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

No description

Parameters

array $assets
$targetPath

at line 237
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 250
protected applyCacheOnFiles($files)

No description

Parameters

$files

at line 282
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 315
void registerBundle($extension, $files, null $destination = null, string $appContext = 'main')

Registers bundle.

Parameters

$extension
$files
null $destination
string $appContext

Return Value

void

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

Returns bundles.

Parameters

string $extension
string $appContext

Return Value

array

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

Returns filters.

Parameters

string $extension

Return Value

array

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

Clears any registered filters.

Parameters

string $extension

Return Value

CombinesAssets

at line 403
protected getCacheKey(array $assets)

No description

Parameters

array $assets

at line 410
protected getCache($cacheKey)

No description

Parameters

$cacheKey

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

No description

Parameters

$cacheKey
$cacheData