class AssetsHelper extends Helper

deprecated since version 4.3, to be removed in 5.0; use Twig instead.

AssetsHelper helps manage asset URLs.

Properties

protected $charset from Helper

Methods

setCharset(string $charset)

Sets the default charset.

from Helper
string
getCharset()

Gets the default charset.

from Helper
__construct(Packages $packages)

No description

string
getUrl(string $path, string $packageName = null)

Returns the public url/path of an asset.

string
getVersion(string $path, string $packageName = null)

Returns the version of an asset.

string
getName()

Returns the canonical name of this helper.

Details

in Helper at line 31
setCharset(string $charset)

Sets the default charset.

Parameters

string $charset The charset

in Helper at line 41
string getCharset()

Gets the default charset.

Return Value

string The default charset

at line 30
__construct(Packages $packages)

Parameters

Packages $packages

at line 46
string getUrl(string $path, string $packageName = null)

Returns the public url/path of an asset.

If the package used to generate the path is an instance of UrlPackage, you will always get a URL and not a path.

Parameters

string $path A public path
string $packageName The name of the asset package to use

Return Value

string The public path of the asset

at line 59
string getVersion(string $path, string $packageName = null)

Returns the version of an asset.

Parameters

string $path A public path
string $packageName The name of the asset package to use

Return Value

string The asset version

at line 67
string getName()

Returns the canonical name of this helper.

Return Value

string The canonical name