Class

Symfony\Component\Templating\Asset\UrlPackage

class UrlPackage extends Package

The URL packages adds a version and a base URL to asset URLs.

Methods

__construct(string|array $baseUrls = array(), string $version = null, string $format = null)

Constructor.

string getVersion()

Returns the asset package version.

from Package
string getUrl(string $path)

Returns an absolute or root-relative public path.

string getBaseUrl($path)

Returns the base URL for a path.

Details

at line 30
public __construct(string|array $baseUrls = array(), string $version = null, string $format = null)

Constructor.

Parameters

string|array $baseUrls Base asset URLs
string $version The package version
string $format The format used to apply the version

in Package at line 36
public string getVersion()

Returns the asset package version.

Return Value

string The version string

at line 44
public string getUrl(string $path)

Returns an absolute or root-relative public path.

Parameters

string $path A path

Return Value

string The public path

at line 64
public string getBaseUrl($path)

Returns the base URL for a path.

Parameters

$path

Return Value

string The base URL