Assets
extends PropertyObject
in package
uses
TestingAssetsTrait, LegacyAssetsTrait
Class Assets
Table of Contents
Constants
- CSS = 'css'
- CSS_COLLECTION = 'assets_css'
- CSS_REGEX = '/.\.css$/i'
- CSS_TYPE = \Grav\Common\Assets\Css::class
- DEFAULT_REGEX = '/.\.(css|js)$/i'
- INLINE_CSS_TYPE = \Grav\Common\Assets\InlineCss::class
- INLINE_JS_MODULE_TYPE = \Grav\Common\Assets\InlineJsModule::class
- INLINE_JS_TYPE = \Grav\Common\Assets\InlineJs::class
- JS = 'js'
- JS_COLLECTION = 'assets_js'
- JS_MODULE = 'js_module'
- JS_MODULE_COLLECTION = 'assets_js_module'
- JS_MODULE_REGEX = '/.\.mjs$/i'
- JS_MODULE_TYPE = \Grav\Common\Assets\JsModule::class
- JS_REGEX = '/.\.js$/i'
- JS_TYPE = \Grav\Common\Assets\Js::class
- LINK = 'link'
- LINK_COLLECTION = 'assets_link'
- LINK_TYPE = \Grav\Common\Assets\Link::class
Properties
- $assets_css : array<string|int, mixed>
- $assets_dir : string
- $assets_js : array<string|int, mixed>
- $assets_js_module : array<string|int, mixed>
- $assets_link : array<string|int, mixed>
- $assets_url : string
- $autoload : string
- $collections : array<string|int, mixed>|null
- $css_pipeline : bool
- $css_pipeline_before_excludes : bool
- $css_pipeline_include_externals : bool
- $enable_asset_timestamp : bool
- $fetch_command : Closure|string
- $js_module_pipeline : bool
- $js_module_pipeline_before_excludes : bool
- $js_module_pipeline_include_externals : bool
- $js_pipeline : bool
- $js_pipeline_before_excludes : bool
- $js_pipeline_include_externals : bool
- $order : array<string|int, mixed>
- $pipeline_options : array<string|int, mixed>
- $timestamp : string
- $type : string
- $_definedProperties : array<string|int, mixed>
- $_key : string
Methods
- __construct() : mixed
- __get() : mixed
- Returns the value at specified offset.
- __isset() : bool
- Checks whether or not an offset exists.
- __serialize() : array<string|int, mixed>
- __set() : void
- Assigns a value to the specified offset.
- __toString() : string
- Returns a string representation of this object.
- __unserialize() : void
- __unset() : void
- Magic method to unset the attribute
- add() : $this
- Add an asset or a collection of assets.
- addAsyncJs() : Assets
- Convenience wrapper for async loading of JavaScript
- addCss() : $this
- Add a CSS asset or a collection of assets.
- addDeferJs() : Assets
- Convenience wrapper for deferred loading of JavaScript
- addDir() : $this
- Add all assets matching $pattern within $directory.
- addDirCss() : $this
- Add all CSS assets within $directory
- addDirJs() : $this
- Add all JavaScript assets within $directory
- addInlineCss() : $this
- Add an Inline CSS asset or a collection of assets.
- addInlineJs() : $this
- Add an Inline JS asset or a collection of assets.
- addInlineJsModule() : $this
- Add an Inline JS asset or a collection of assets.
- addJs() : $this
- Add a JS asset or a collection of assets.
- addJsModule() : $this
- Add a JS asset or a collection of assets.
- addLink() : $this
- Add a CSS asset or a collection of assets.
- all() : string
- config() : $this
- Set up configuration options.
- css() : string
- Build the CSS link tags.
- defNestedProperty() : $this
- defProperty() : $this
- exists() : bool
- Determines if an asset exists as a collection, CSS or JS reference
- getCollections() : array<string|int, mixed>
- Return the array of all the registered collections
- getCss() : array<string|int, mixed>
- Return the array of all the registered CSS assets If a $key is provided, it will try to return only that asset else it will return null
- getJs() : array<string|int, mixed>
- Return the array of all the registered JS assets If a $key is provided, it will try to return only that asset else it will return null
- getKey() : string
- getNestedProperty() : mixed
- getProperty() : mixed
- getTimestamp() : string|null
- Get the timestamp for assets
- getType() : string
- hasKey() : bool
- hasNestedProperty() : bool
- hasProperty() : bool
- init() : void
- Initialization called in the Grav lifecycle to initialize the Assets with appropriate configuration
- js() : string
- Build the JavaScript script tags.
- jsModule() : string
- Build the Javascript Modules tags
- jsonSerialize() : array<string|int, mixed>
- Implements JsonSerializable interface.
- link() : string
- Build the CSS link tags.
- offsetExists() : bool
- Whether or not an offset exists.
- offsetGet() : mixed
- Returns the value at specified offset.
- offsetSet() : void
- Assigns a value to the specified offset.
- offsetUnset() : void
- Unsets an offset.
- registerCollection() : $this
- Add/replace collection.
- removeCss() : $this
- Removes an item from the CSS array if set
- removeJs() : $this
- Removes an item from the JS array if set
- render() : string
- reset() : $this
- Reset all assets.
- resetCss() : $this
- Reset CSS assets.
- resetJs() : $this
- Reset JavaScript assets.
- setCollection() : $this
- Set the array of collections explicitly
- setCss() : $this
- Set the whole array of CSS assets
- setCssPipeline() : $this
- Sets the state of CSS Pipeline
- setJs() : $this
- Set the whole array of JS assets
- setJsPipeline() : $this
- Sets the state of JS Pipeline
- setNestedProperty() : $this
- setProperty() : $this
- setTimestamp() : mixed
- Explicitly set's a timestamp for assets
- unsetNestedProperty() : $this
- unsetProperty() : $this
- addType() : $this
- createArgumentsFromLegacy() : array<string|int, mixed>
- doGetProperty() : mixed
- doHasProperty() : bool
- doSerialize() : array<string|int, mixed>
- doSetProperty() : void
- doUnserialize() : void
- doUnsetProperty() : void
- filterAssets() : array<string|int, mixed>|false
- getBaseType() : string
- getElement() : mixed|null
- getElements() : array<string|int, mixed>
- getTypePrefix() : string
- initObjectProperties() : void
- isPropertyLoaded() : bool
- isValidType() : bool
- offsetLoad() : mixed
- offsetPrepare() : mixed
- offsetSerialize() : mixed
- rglob() : array<string|int, mixed>
- Recursively get files matching $pattern within $directory.
- setElements() : void
- setKey() : $this
- sortAssets() : array<string|int, mixed>
- unifyLegacyArguments() : array<string|int, mixed>
Constants
CSS
public
mixed
CSS
= 'css'
CSS_COLLECTION
public
mixed
CSS_COLLECTION
= 'assets_css'
CSS_REGEX
public
mixed
CSS_REGEX
= '/.\.css$/i'
Tags
CSS_TYPE
public
mixed
CSS_TYPE
= \Grav\Common\Assets\Css::class
DEFAULT_REGEX
public
mixed
DEFAULT_REGEX
= '/.\.(css|js)$/i'
Tags
INLINE_CSS_TYPE
public
mixed
INLINE_CSS_TYPE
= \Grav\Common\Assets\InlineCss::class
INLINE_JS_MODULE_TYPE
public
mixed
INLINE_JS_MODULE_TYPE
= \Grav\Common\Assets\InlineJsModule::class
INLINE_JS_TYPE
public
mixed
INLINE_JS_TYPE
= \Grav\Common\Assets\InlineJs::class
JS
public
mixed
JS
= 'js'
JS_COLLECTION
public
mixed
JS_COLLECTION
= 'assets_js'
JS_MODULE
public
mixed
JS_MODULE
= 'js_module'
JS_MODULE_COLLECTION
public
mixed
JS_MODULE_COLLECTION
= 'assets_js_module'
JS_MODULE_REGEX
public
mixed
JS_MODULE_REGEX
= '/.\.mjs$/i'
Tags
JS_MODULE_TYPE
public
mixed
JS_MODULE_TYPE
= \Grav\Common\Assets\JsModule::class
JS_REGEX
public
mixed
JS_REGEX
= '/.\.js$/i'
Tags
JS_TYPE
public
mixed
JS_TYPE
= \Grav\Common\Assets\Js::class
LINK
public
mixed
LINK
= 'link'
LINK_COLLECTION
public
mixed
LINK_COLLECTION
= 'assets_link'
LINK_TYPE
public
mixed
LINK_TYPE
= \Grav\Common\Assets\Link::class
Properties
$assets_css
protected
array<string|int, mixed>
$assets_css
= []
$assets_dir
protected
string
$assets_dir
$assets_js
protected
array<string|int, mixed>
$assets_js
= []
$assets_js_module
protected
array<string|int, mixed>
$assets_js_module
= []
$assets_link
protected
array<string|int, mixed>
$assets_link
= []
$assets_url
protected
string
$assets_url
$autoload
protected
string
$autoload
$collections
protected
array<string|int, mixed>|null
$collections
$css_pipeline
protected
bool
$css_pipeline
$css_pipeline_before_excludes
protected
bool
$css_pipeline_before_excludes
$css_pipeline_include_externals
protected
bool
$css_pipeline_include_externals
$enable_asset_timestamp
protected
bool
$enable_asset_timestamp
$fetch_command
protected
Closure|string
$fetch_command
$js_module_pipeline
protected
bool
$js_module_pipeline
$js_module_pipeline_before_excludes
protected
bool
$js_module_pipeline_before_excludes
$js_module_pipeline_include_externals
protected
bool
$js_module_pipeline_include_externals
$js_pipeline
protected
bool
$js_pipeline
$js_pipeline_before_excludes
protected
bool
$js_pipeline_before_excludes
$js_pipeline_include_externals
protected
bool
$js_pipeline_include_externals
$order
protected
array<string|int, mixed>
$order
= []
Keeping track for order counts (for sorting)
$pipeline_options
protected
array<string|int, mixed>
$pipeline_options
= []
$timestamp
protected
string
$timestamp
$type
protected
static string
$type
$_definedProperties
private
array<string|int, mixed>
$_definedProperties
$_key
private
string
$_key
Methods
__construct()
public
__construct([array<string|int, mixed> $elements = [] ][, string|null $key = null ]) : mixed
Parameters
- $elements : array<string|int, mixed> = []
- $key : string|null = null
Tags
__get()
Returns the value at specified offset.
public
__get(mixed $offset) : mixed
Parameters
- $offset : mixed
-
The offset to retrieve.
Attributes
- #[ReturnTypeWillChange]
Return values
mixed —Can return all value types.
__isset()
Checks whether or not an offset exists.
public
__isset(mixed $offset) : bool
Parameters
- $offset : mixed
-
An offset to check for.
Attributes
- #[ReturnTypeWillChange]
Return values
bool —Returns TRUE on success or FALSE on failure.
__serialize()
public
final __serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__set()
Assigns a value to the specified offset.
public
__set(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
-
The offset to assign the value to.
- $value : mixed
-
The value to set.
Attributes
- #[ReturnTypeWillChange]
__toString()
Returns a string representation of this object.
public
__toString() : string
Attributes
- #[ReturnTypeWillChange]
Return values
string__unserialize()
public
final __unserialize(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
__unset()
Magic method to unset the attribute
public
__unset(mixed $offset) : void
Parameters
- $offset : mixed
-
The name value to unset
Attributes
- #[ReturnTypeWillChange]
add()
Add an asset or a collection of assets.
public
add(string|array<string|int, string> $asset) : $this
It automatically detects the asset type (JavaScript, CSS or collection). You may add more than one asset passing an array as argument.
Parameters
- $asset : string|array<string|int, string>
Return values
$thisaddAsyncJs()
Convenience wrapper for async loading of JavaScript
public
addAsyncJs(string|array<string|int, mixed> $asset[, int $priority = 10 ][, bool $pipeline = true ][, string $group = 'head' ]) : Assets
Please use dynamic method with ['loading' => 'async'].
Parameters
- $asset : string|array<string|int, mixed>
- $priority : int = 10
- $pipeline : bool = true
- $group : string = 'head'
-
name of the group
Return values
AssetsaddCss()
Add a CSS asset or a collection of assets.
public
addCss(mixed $asset) : $this
Parameters
- $asset : mixed
Return values
$thisaddDeferJs()
Convenience wrapper for deferred loading of JavaScript
public
addDeferJs(string|array<string|int, mixed> $asset[, int $priority = 10 ][, bool $pipeline = true ][, string $group = 'head' ]) : Assets
Please use dynamic method with ['loading' => 'defer'].
Parameters
- $asset : string|array<string|int, mixed>
- $priority : int = 10
- $pipeline : bool = true
- $group : string = 'head'
-
name of the group
Return values
AssetsaddDir()
Add all assets matching $pattern within $directory.
public
addDir(string $directory[, string $pattern = self::DEFAULT_REGEX ]) : $this
Parameters
- $directory : string
-
Relative to the Grav root path, or a stream identifier
- $pattern : string = self::DEFAULT_REGEX
-
(regex)
Return values
$thisaddDirCss()
Add all CSS assets within $directory
public
addDirCss(string $directory) : $this
Parameters
- $directory : string
-
Relative to the Grav root path, or a stream identifier
Return values
$thisaddDirJs()
Add all JavaScript assets within $directory
public
addDirJs(string $directory) : $this
Parameters
- $directory : string
-
Relative to the Grav root path, or a stream identifier
Return values
$thisaddInlineCss()
Add an Inline CSS asset or a collection of assets.
public
addInlineCss(mixed $asset) : $this
Parameters
- $asset : mixed
Return values
$thisaddInlineJs()
Add an Inline JS asset or a collection of assets.
public
addInlineJs(mixed $asset) : $this
Parameters
- $asset : mixed
Return values
$thisaddInlineJsModule()
Add an Inline JS asset or a collection of assets.
public
addInlineJsModule(mixed $asset) : $this
Parameters
- $asset : mixed
Return values
$thisaddJs()
Add a JS asset or a collection of assets.
public
addJs(mixed $asset) : $this
Parameters
- $asset : mixed
Return values
$thisaddJsModule()
Add a JS asset or a collection of assets.
public
addJsModule(mixed $asset) : $this
Parameters
- $asset : mixed
Return values
$thisaddLink()
Add a CSS asset or a collection of assets.
public
addLink(mixed $asset) : $this
Parameters
- $asset : mixed
Return values
$thisall()
public
all([string $group = 'head' ][, array<string|int, mixed> $attributes = [] ]) : string
Parameters
- $group : string = 'head'
- $attributes : array<string|int, mixed> = []
Return values
stringconfig()
Set up configuration options.
public
config(array<string|int, mixed> $config) : $this
All the class properties except 'js' and 'css' are accepted here. Also, an extra option 'autoload' may be passed containing an array of assets and/or collections that will be automatically added on startup.
Parameters
- $config : array<string|int, mixed>
-
Configurable options.
Return values
$thiscss()
Build the CSS link tags.
public
css([string $group = 'head' ][, array<string|int, mixed> $attributes = [] ][, mixed $include_link = true ]) : string
Parameters
- $group : string = 'head'
-
name of the group
- $attributes : array<string|int, mixed> = []
- $include_link : mixed = true
Return values
stringdefNestedProperty()
public
defNestedProperty(string $property, mixed $default[, string|null $separator = null ]) : $this
Parameters
- $property : string
-
Object property to be updated.
- $default : mixed
-
Default value.
- $separator : string|null = null
-
Separator, defaults to '.'
Tags
Return values
$thisdefProperty()
public
defProperty(string $property, mixed $default) : $this
Parameters
- $property : string
-
Object property to be defined.
- $default : mixed
-
Default value.
Return values
$thisexists()
Determines if an asset exists as a collection, CSS or JS reference
public
exists(string $asset) : bool
Parameters
- $asset : string
Return values
boolgetCollections()
Return the array of all the registered collections
public
getCollections() : array<string|int, mixed>
Return values
array<string|int, mixed>getCss()
Return the array of all the registered CSS assets If a $key is provided, it will try to return only that asset else it will return null
public
getCss([string|null $key = null ]) : array<string|int, mixed>
Parameters
- $key : string|null = null
-
the asset key
Return values
array<string|int, mixed>getJs()
Return the array of all the registered JS assets If a $key is provided, it will try to return only that asset else it will return null
public
getJs([string|null $key = null ]) : array<string|int, mixed>
Parameters
- $key : string|null = null
-
the asset key
Return values
array<string|int, mixed>getKey()
public
getKey() : string
Return values
stringgetNestedProperty()
public
getNestedProperty(string $property[, mixed|null $default = null ][, string|null $separator = null ]) : mixed
Parameters
- $property : string
-
Object property to be fetched.
- $default : mixed|null = null
-
Default value if property has not been set.
- $separator : string|null = null
-
Separator, defaults to '.'
Return values
mixed —Property value.
getProperty()
public
getProperty(string $property[, mixed $default = null ]) : mixed
Parameters
- $property : string
-
Object property to be fetched.
- $default : mixed = null
-
Default value if property has not been set.
Return values
mixed —Property value.
getTimestamp()
Get the timestamp for assets
public
getTimestamp([bool $include_join = true ]) : string|null
Parameters
- $include_join : bool = true
Return values
string|nullgetType()
public
getType([bool $prefix = true ]) : string
Parameters
- $prefix : bool = true
Return values
stringhasKey()
public
hasKey() : bool
Return values
boolhasNestedProperty()
public
hasNestedProperty(string $property[, string|null $separator = null ]) : bool
Parameters
- $property : string
-
Object property name.
- $separator : string|null = null
-
Separator, defaults to '.'
Return values
bool —True if property has been defined (can be null).
hasProperty()
public
hasProperty(string $property) : bool
Parameters
- $property : string
-
Object property name.
Return values
bool —True if property has been defined (can be null).
init()
Initialization called in the Grav lifecycle to initialize the Assets with appropriate configuration
public
init() : void
js()
Build the JavaScript script tags.
public
js([string $group = 'head' ][, array<string|int, mixed> $attributes = [] ][, mixed $include_js_module = true ]) : string
Parameters
- $group : string = 'head'
-
name of the group
- $attributes : array<string|int, mixed> = []
- $include_js_module : mixed = true
Return values
stringjsModule()
Build the Javascript Modules tags
public
jsModule([string $group = 'head' ][, array<string|int, mixed> $attributes = [] ]) : string
Parameters
- $group : string = 'head'
- $attributes : array<string|int, mixed> = []
Return values
stringjsonSerialize()
Implements JsonSerializable interface.
public
jsonSerialize() : array<string|int, mixed>
Attributes
- #[ReturnTypeWillChange]
Return values
array<string|int, mixed>link()
Build the CSS link tags.
public
link([string $group = 'head' ][, array<string|int, mixed> $attributes = [] ]) : string
Parameters
- $group : string = 'head'
-
name of the group
- $attributes : array<string|int, mixed> = []
Return values
stringoffsetExists()
Whether or not an offset exists.
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
-
An offset to check for.
Attributes
- #[ReturnTypeWillChange]
Return values
bool —Returns TRUE on success or FALSE on failure.
offsetGet()
Returns the value at specified offset.
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
-
The offset to retrieve.
Attributes
- #[ReturnTypeWillChange]
Return values
mixed —Can return all value types.
offsetSet()
Assigns a value to the specified offset.
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
-
The offset to assign the value to.
- $value : mixed
-
The value to set.
Attributes
- #[ReturnTypeWillChange]
offsetUnset()
Unsets an offset.
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
-
The offset to unset.
Attributes
- #[ReturnTypeWillChange]
registerCollection()
Add/replace collection.
public
registerCollection(string $collectionName, array<string|int, mixed> $assets[, bool $overwrite = false ]) : $this
Parameters
- $collectionName : string
- $assets : array<string|int, mixed>
- $overwrite : bool = false
Return values
$thisremoveCss()
Removes an item from the CSS array if set
public
removeCss(string $key) : $this
Parameters
- $key : string
-
The asset key
Return values
$thisremoveJs()
Removes an item from the JS array if set
public
removeJs(string $key) : $this
Parameters
- $key : string
-
The asset key
Return values
$thisrender()
public
render(string $type[, string $group = 'head' ][, array<string|int, mixed> $attributes = [] ]) : string
Parameters
- $type : string
- $group : string = 'head'
- $attributes : array<string|int, mixed> = []
Return values
stringreset()
Reset all assets.
public
reset() : $this
Return values
$thisresetCss()
Reset CSS assets.
public
resetCss() : $this
Return values
$thisresetJs()
Reset JavaScript assets.
public
resetJs() : $this
Return values
$thissetCollection()
Set the array of collections explicitly
public
setCollection(array<string|int, mixed> $collections) : $this
Parameters
- $collections : array<string|int, mixed>
Return values
$thissetCss()
Set the whole array of CSS assets
public
setCss(array<string|int, mixed> $css) : $this
Parameters
- $css : array<string|int, mixed>
Return values
$thissetCssPipeline()
Sets the state of CSS Pipeline
public
setCssPipeline(bool $value) : $this
Parameters
- $value : bool
Return values
$thissetJs()
Set the whole array of JS assets
public
setJs(array<string|int, mixed> $js) : $this
Parameters
- $js : array<string|int, mixed>
Return values
$thissetJsPipeline()
Sets the state of JS Pipeline
public
setJsPipeline(bool $value) : $this
Parameters
- $value : bool
Return values
$thissetNestedProperty()
public
setNestedProperty(string $property, mixed $value[, string|null $separator = null ]) : $this
Parameters
- $property : string
-
Object property to be updated.
- $value : mixed
-
New value.
- $separator : string|null = null
-
Separator, defaults to '.'
Tags
Return values
$thissetProperty()
public
setProperty(string $property, mixed $value) : $this
Parameters
- $property : string
-
Object property to be updated.
- $value : mixed
-
New value.
Return values
$thissetTimestamp()
Explicitly set's a timestamp for assets
public
setTimestamp(string|int $value) : mixed
Parameters
- $value : string|int
unsetNestedProperty()
public
unsetNestedProperty(string $property[, string|null $separator = null ]) : $this
Parameters
- $property : string
-
Object property to be updated.
- $separator : string|null = null
-
Separator, defaults to '.'
Tags
Return values
$thisunsetProperty()
public
unsetProperty(string $property) : $this
Parameters
- $property : string
-
Object property to be unset.
Return values
$thisaddType()
protected
addType(string $collection, string $type, string|array<string|int, string> $asset, array<string|int, mixed> $options) : $this
Parameters
- $collection : string
- $type : string
- $asset : string|array<string|int, string>
- $options : array<string|int, mixed>
Return values
$thiscreateArgumentsFromLegacy()
protected
createArgumentsFromLegacy(array<string|int, mixed> $args, array<string|int, mixed> $defaults) : array<string|int, mixed>
Parameters
- $args : array<string|int, mixed>
- $defaults : array<string|int, mixed>
Return values
array<string|int, mixed>doGetProperty()
protected
& doGetProperty(string $property[, mixed $default = null ][, callable|bool $doCreate = false ]) : mixed
Parameters
- $property : string
-
Object property to be fetched.
- $default : mixed = null
-
Default value if property has not been set.
- $doCreate : callable|bool = false
-
Set true to create variable.
Return values
mixed —Property value.
doHasProperty()
protected
doHasProperty(string $property) : bool
Parameters
- $property : string
-
Object property name.
Return values
bool —True if property has been defined (can be null).
doSerialize()
protected
doSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>doSetProperty()
protected
doSetProperty(string $property, mixed $value) : void
Parameters
- $property : string
-
Object property to be updated.
- $value : mixed
-
New value.
Tags
doUnserialize()
protected
doUnserialize(array<string|int, mixed> $serialized) : void
Parameters
- $serialized : array<string|int, mixed>
doUnsetProperty()
protected
doUnsetProperty(string $property) : void
Parameters
- $property : string
-
Object property to be unset.
filterAssets()
protected
filterAssets(array<string|int, mixed> $assets, string $key, string $value[, bool $sort = false ]) : array<string|int, mixed>|false
Parameters
- $assets : array<string|int, mixed>
- $key : string
- $value : string
- $sort : bool = false
Return values
array<string|int, mixed>|falsegetBaseType()
protected
getBaseType(class-string $type) : string
Parameters
- $type : class-string
Return values
stringgetElement()
protected
getElement(string $property[, mixed|null $default = null ]) : mixed|null
Parameters
- $property : string
- $default : mixed|null = null
Return values
mixed|nullgetElements()
protected
getElements() : array<string|int, mixed>
Return values
array<string|int, mixed>getTypePrefix()
protected
getTypePrefix() : string
Return values
stringinitObjectProperties()
protected
initObjectProperties() : void
isPropertyLoaded()
protected
isPropertyLoaded(string $property) : bool
Parameters
- $property : string
-
Object property name.
Return values
bool —True if property has been loaded.
isValidType()
protected
isValidType(class-string $type) : bool
Parameters
- $type : class-string
Return values
booloffsetLoad()
protected
offsetLoad(string $offset, mixed $value) : mixed
Parameters
- $offset : string
- $value : mixed
offsetPrepare()
protected
offsetPrepare(string $offset, mixed $value) : mixed
Parameters
- $offset : string
- $value : mixed
offsetSerialize()
protected
offsetSerialize(string $offset, mixed $value) : mixed
Parameters
- $offset : string
- $value : mixed
rglob()
Recursively get files matching $pattern within $directory.
protected
rglob(string $directory, string $pattern[, string|null $ltrim = null ]) : array<string|int, mixed>
Parameters
- $directory : string
- $pattern : string
-
(regex)
- $ltrim : string|null = null
-
Will be trimmed from the left of the file path
Return values
array<string|int, mixed>setElements()
protected
setElements(array<string|int, mixed> $elements) : void
Parameters
- $elements : array<string|int, mixed>
setKey()
protected
setKey(string $key) : $this
Parameters
- $key : string
Return values
$thissortAssets()
protected
sortAssets(array<string|int, mixed> $assets) : array<string|int, mixed>
Parameters
- $assets : array<string|int, mixed>
Return values
array<string|int, mixed>unifyLegacyArguments()
protected
unifyLegacyArguments(array<string|int, mixed> $args[, string $type = Assets::CSS_TYPE ]) : array<string|int, mixed>
Parameters
- $args : array<string|int, mixed>
- $type : string = Assets::CSS_TYPE