Asset

Implements \AssetInterface

Class Asset

category

System

package

Http

subpackage

ValueObjects

Methods

Initializes the asset.

__construct(string $path) 
Throws
\InvalidArgumentException

Arguments

$path

string

Relative path to the asset file (relative to the "src" directory). Provide only the filename for translations (no path is required - e.g. general.lang.inc.php).

Get asset HTML markup.

__toString() : string

Response

string

Returns the HTML markup that will load the file when the page is loaded.

Get the path of the asset.

getPath() : string

Response

string

Get the type of the asset.

getType() : string

Response

string

Constants

JavaScript Asset Type

JAVASCRIPT

CSS Asset Type

CSS

JavaScript Translation

TRANSLATION

Properties

Asset's relative path.

path : string
var

Asset's relative path.

Type(s)

string

Asset's type (defined by the file extension).

type : string
var

Asset's type (defined by the file extension).

Type(s)

string