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 | |
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 50
protected
initCombiner()
No description
in
CombinesAssets 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);
in
CombinesAssets 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'), );
in
CombinesAssets at line 142
combineGetContents($cacheKey)
No description
in
CombinesAssets at line 172
protected
prepareAssets(array $assets)
No description
in
CombinesAssets at line 181
protected
prepareCombiner(array $assets, $targetPath = null)
No description
in
CombinesAssets 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/
in
CombinesAssets at line 240
protected
applyCacheOnFiles($files)
No description
in
CombinesAssets at line 272
CombinesAssets
registerFilter(string|array $extension, object $filter)
Register a filter to apply to the combining process.
in
CombinesAssets at line 305
void
registerBundle($extension, $files, null $destination = null, string $appContext = 'main')
Registers bundle.
in
CombinesAssets at line 341
array
getBundles(string $extension = null, string $appContext = 'main')
Returns bundles.
in
CombinesAssets at line 359
array
getFilters(string $extension = null)
Returns filters.
in
CombinesAssets at line 377
CombinesAssets
resetFilters(string $extension = null)
Clears any registered filters.
in
CombinesAssets at line 393
protected
getCacheKey(array $assets)
No description
in
CombinesAssets at line 400
protected
getCache($cacheKey)
No description
in
CombinesAssets at line 409
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 263
protected
filterAssetsToCombine($assets)
No description
at line 284
protected array
getUniqueAssets($type)
Removes duplicate assets from the assets array.
at line 308
protected
prepUrl($path, $suffix = null)
No description
at line 318
protected
buildAssetUrls($type, $assets)
No description
at line 330
protected
buildAssetUrl($type, $file, $attributes = null)
No description
at line 354
protected
transformJsVar($value)
No description
at line 359
protected
transformJsObjectVar($value)
No description