class Package implements PackageInterface

deprecated since 2.7, will be removed in 3.0. Use the Asset component instead.

The basic package will add a version to asset URLs.

Methods

__construct(string $version = null, string $format = '')

No description

string
getVersion()

Returns the asset package version.

string
getUrl(string $path, string|bool|null $version = null)

Returns an absolute or root-relative public path.

string
applyVersion(string $path, string|bool|null $version = null)

Applies version to the supplied path.

Details

at line 32
__construct(string $version = null, string $format = '')

Parameters

string $version The package version
string $format The format used to apply the version

at line 41
string getVersion()

Returns the asset package version.

Return Value

string The version string

at line 49
string getUrl(string $path, string|bool|null $version = null)

Returns an absolute or root-relative public path.

Parameters

string $path A path
string|bool|null $version A specific version for the path

Return Value

string The public path

at line 66
protected string applyVersion(string $path, string|bool|null $version = null)

Applies version to the supplied path.

Parameters

string $path A path
string|bool|null $version A specific version

Return Value

string The versionized path