class ScriptAsset implements Asset, HtmlRenderable

JavaScript file.

Methods

__construct(string $url, string|null $file = null, string|null $type = null, string|null $integrity = null, string|bool|null $crossorigin = null)

No description

string
__toString()

Returns the asset URL.

Html
getImportElement()

Returns the HTML element used to import the asset (img, script, link rel="stylesheet", etc.).

Html
getPreloadElement()

Returns the HTML element used to preload the asset (link rel="preload" or rel="modulepreload").

Details

at line 13
__construct(string $url, string|null $file = null, string|null $type = null, string|null $integrity = null, string|bool|null $crossorigin = null)

No description

Parameters

string $url
string|null $file
string|null $type
string|null $integrity
string|bool|null $crossorigin

at line 24
string __toString()

Returns the asset URL.

Return Value

string

at line 30
Html getImportElement()

Returns the HTML element used to import the asset (img, script, link rel="stylesheet", etc.).

Return Value

Html

at line 41
Html getPreloadElement()

Returns the HTML element used to preload the asset (link rel="preload" or rel="modulepreload").

Return Value

Html