AttachedAssetsInterface
interface AttachedAssetsInterface (View source)
The attached assets collection for the current response.
Allows for storage of:
- an ordered list of asset libraries (to be loaded for the current response)
- attached JavaScript settings (to be loaded for the current response)
- a set of asset libraries that the client already has loaded (as indicated in the request, to not be loaded for the current response)
Methods
Creates an AttachedAssetsInterface object from a render array.
Sets the asset libraries attached to the current response.
Returns the asset libraries attached to the current response.
Sets the JavaScript settings that are attached to the current response.
Returns the settings attached to the current response.
Sets the asset libraries that the current request marked as already loaded.
Returns the set of already loaded asset libraries.
Details
static AttachedAssetsInterface
createFromRenderArray(array $render_array)
Creates an AttachedAssetsInterface object from a render array.
$this
setLibraries(array $libraries)
Sets the asset libraries attached to the current response.
string[]
getLibraries()
Returns the asset libraries attached to the current response.
$this
setSettings(array $settings)
Sets the JavaScript settings that are attached to the current response.
array
getSettings()
Returns the settings attached to the current response.
$this
setAlreadyLoadedLibraries(array $libraries)
Sets the asset libraries that the current request marked as already loaded.
string[]
getAlreadyLoadedLibraries()
Returns the set of already loaded asset libraries.