Assets
class Assets
Assets Class * Within controllers, widgets, components and views, use facade: Assets::addCss($path, $options); Assets::addJs($path, $options);
Traits
Properties
protected array | $bundles | from CombinesAssets | |
protected array | $filters | from CombinesAssets | |
protected string | $storagePath | from CombinesAssets | |
bool | $cacheKeyPrefix | from CombinesAssets | |
bool | $useCache | from CombinesAssets | |
bool | $useMinify | from CombinesAssets | |
protected | $assetsCombinerUri | from CombinesAssets | |
protected | $combineAssets | from CombinesAssets | |
static protected | $registeredPaths | ||
static protected | $registeredCallback | ||
protected | $assets | ||
protected | $jsVarNamespace |
Methods
Combines JavaScript or StyleSheet file references to produce a page relative URL to the combined contents.
Combines a collection of assets files to a destination file
Returns the target path used with the combiner.
Register a filter to apply to the combining process.
Registers bundle.
Returns bundles.
Clears any registered filters.
No description
No description
No description
Set the default assets paths.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Removes duplicate assets from the assets array.
No description
No description
No description
No description
No description
Details
in
CombinesAssets at line 55
protected
initCombiner()
No description
in
CombinesAssets 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);
in
CombinesAssets 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'), );
in
CombinesAssets at line 156
combineGetContents($cacheKey)
No description
in
CombinesAssets at line 186
protected
prepareAssets(array $assets)
No description
in
CombinesAssets at line 195
protected
prepareCombiner(array $assets, $targetPath = null)
No description
in
CombinesAssets 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/
in
CombinesAssets at line 250
protected
applyCacheOnFiles($files)
No description
in
CombinesAssets at line 282
CombinesAssets
registerFilter(string|array $extension, object $filter)
Register a filter to apply to the combining process.
in
CombinesAssets at line 315
void
registerBundle($extension, $files, null $destination = null, string $appContext = 'main')
Registers bundle.
in
CombinesAssets at line 351
array
getBundles(string $extension = null, string $appContext = 'main')
Returns bundles.
in
CombinesAssets at line 369
array
getFilters(string $extension = null)
Returns filters.
in
CombinesAssets at line 387
CombinesAssets
resetFilters(string $extension = null)
Clears any registered filters.
in
CombinesAssets at line 403
protected
getCacheKey(array $assets)
No description
in
CombinesAssets at line 410
protected
getCache($cacheKey)
No description
in
CombinesAssets at line 419
protected
putCache($cacheKey, $cacheData)
No description
at line 30
__construct()
No description
at line 35
initialize()
No description
at line 46
static
registerCallback(callable $callback)
No description
at line 58
void
registerSourcePath(string $path)
Set the default assets paths.
at line 63
addFromManifest($path)
No description
at line 83
addTags(array $tags = [])
No description
at line 101
addTag($type, $tag, $options = [])
No description
at line 118
getFavIcon()
No description
at line 135
getMetas()
No description
at line 147
getCss()
No description
at line 152
getJs()
No description
at line 157
getJsVars()
No description
at line 174
addFavIcon($icon)
No description
at line 181
addMeta(array $meta = [])
No description
at line 188
addCss($path, $attributes = null)
No description
at line 195
addJs($path, $attributes = null)
No description
at line 202
putJsVars(array $variables)
No description
at line 207
mergeJsVars($key, $value)
No description
at line 216
flush()
No description
at line 221
protected
putAsset($type, $path, $attributes)
No description
at line 226
protected
getAsset($type)
No description
at line 244
protected
getAssetPath($name)
No description
at line 260
protected
filterAssetsToCombine($assets)
No description
at line 281
protected array
getUniqueAssets($type)
Removes duplicate assets from the assets array.
at line 305
protected
prepUrl($path, $suffix = null)
No description
at line 315
protected
buildAssetUrls($type, $assets)
No description
at line 327
protected
buildAssetUrl($type, $file, $attributes = null)
No description
at line 352
protected
transformJsVar($value)
No description
at line 357
protected
transformJsObjectVar($value)
No description