AssetReference
class AssetReference implements AssetInterface
A reference to an asset in the asset manager.
Properties
private | $am | ||
private | $name | ||
private | $filters | ||
private | $clone | ||
private | $asset |
Methods
No description
Returns an array of filters currently applied.
Clears all filters from the current asset.
Loads the asset into memory and applies load filters.
Applies dump filters and returns the asset as a string.
Returns the loaded content of the current asset.
Sets the content of the current asset.
Returns an absolute path or URL to the source asset's root directory.
Returns the relative path for the source asset.
Returns the asset's source directory.
Returns the URL for the current asset.
Sets the URL for the current asset.
Returns the time the current asset was last modified.
Returns an array of variable names for this asset.
Returns the current values for this asset.
Sets the values for the asset's variables.
No description
No description
No description
Details
at line 34
__construct(AssetManager $am, $name)
No description
at line 40
__clone()
No description
at line 49
ensureFilter(FilterInterface $filter)
Ensures the current asset includes the supplied filter.
at line 54
array
getFilters()
Returns an array of filters currently applied.
at line 61
clearFilters()
Clears all filters from the current asset.
at line 67
load(FilterInterface $additionalFilter = null)
Loads the asset into memory and applies load filters.
You may provide an additional filter to apply during load.
at line 74
string
dump(FilterInterface $additionalFilter = null)
Applies dump filters and returns the asset as a string.
You may provide an additional filter to apply during dump.
Dumping an asset should not change its state.
If the current asset has not been loaded yet, it should be automatically loaded at this time.
at line 81
string
getContent()
Returns the loaded content of the current asset.
at line 86
setContent(string $content)
Sets the content of the current asset.
Filters can use this method to change the content of the asset.
at line 91
string|null
getSourceRoot()
Returns an absolute path or URL to the source asset's root directory.
This value should be an absolute path to a directory in the filesystem, an absolute URL with no path, or null.
For example:
- '/path/to/web'
- 'http://example.com'
- null
at line 96
string|null
getSourcePath()
Returns the relative path for the source asset.
This value can be combined with the asset's source root (if both are non-null) to get something compatible with file_get_contents().
For example:
- 'js/main.js'
- 'main.js'
- null
at line 101
string|null
getSourceDirectory()
Returns the asset's source directory.
The source directory is the directory the asset was located in and can be used to resolve references relative to an asset.
at line 106
string|null
getTargetPath()
Returns the URL for the current asset.
at line 111
setTargetPath(string $targetPath)
Sets the URL for the current asset.
at line 116
int|null
getLastModified()
Returns the time the current asset was last modified.
at line 121
array
getVars()
Returns an array of variable names for this asset.
at line 126
array
getValues()
Returns the current values for this asset.
at line 131
setValues(array $values)
Sets the values for the asset's variables.
at line 138
private
callAsset($method, $arguments = [])
No description
at line 145
private
flushFilters()
No description
at line 154
private
resolve()
No description