PHP Interface Themosis\Asset\IAsset

Datei anzeigen Open project: themosis/framework

Public Methods

Method Description
addAttributes ( array $atts ) : Asset Add attributes to the asset opening tag.
isQueued ( ) : boolean Tells if an asset is queued or not.
localize ( string $objectName, mixed $data ) : Asset Localize data for the linked asset.
remove ( ) : Asset Remove a declared asset.
to ( string $area ) : Asset Allow the developer to define where to load the asset.

Method Details

addAttributes() public method

Add attributes to the asset opening tag.
public addAttributes ( array $atts ) : Asset
$atts array The asset attributes to add.
return Asset

isQueued() public method

Tells if an asset is queued or not.
public isQueued ( ) : boolean
return boolean

localize() public method

Output JS object right before the script output.
public localize ( string $objectName, mixed $data ) : Asset
$objectName string The name of the JS variable that will hold the data.
$data mixed Any data to attach to the JS variable: string, boolean, object, array, ...
return Asset

remove() public method

Remove a declared asset.
public remove ( ) : Asset
return Asset

to() public method

Only 'admin', 'login' and 'customizer' are accepted. If none of those values are used, simply keep the default front-end area.
public to ( string $area ) : Asset
$area string Specify where to load the asset: 'admin', 'login' or 'customizer'.
return Asset