class asset

Properties

protected $components
protected path_helper $path_helper

Methods

__construct(string $url, path_helper $path_helper)

Constructor

set_url(string $url)

Set URL

string
join_url(array $components)

Convert URL components into string

string
get_url()

Get URL

bool
is_relative()

Checks if URL is local and relative

string
get_path()

Get path component of current URL

set_path(string $path, bool $urlencode = false)

Set path component

add_assets_version(string $version)

Add assets_version parameter to URL.

Details

at line 31
__construct(string $url, path_helper $path_helper)

Constructor

Parameters

string $url URL
path_helper $path_helper

Path helper object

at line 43
set_url(string $url)

Set URL

Parameters

string $url URL

at line 54
protected string join_url(array $components)

Convert URL components into string

Parameters

array $components

URL components

Return Value

string URL

at line 112
string get_url()

Get URL

Return Value

string URL

at line 122
bool is_relative()

Checks if URL is local and relative

Return Value

bool

True if URL is local and relative

at line 137
string get_path()

Get path component of current URL

Return Value

string Path

at line 148
set_path(string $path, bool $urlencode = false)

Set path component

Parameters

string $path

Path component

bool $urlencode

If true, parts of path should be encoded with rawurlencode()

at line 187
add_assets_version(string $version)

Add assets_version parameter to URL.

Parameter will not be added if assets_version already exists in URL

Parameters

string $version Version