W3cubDocs

/Symfony 2.7

Symfony\Component\Templating\Asset\PathPackage

class PathPackage extends Package

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

Methods

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

Constructor.

string getVersion()

Returns the asset package version.

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

Returns an absolute or root-relative public path.

string getBasePath()

Returns the base path.

Details

public __construct(string $basePath = null, string $version = null, string $format = null)

Constructor.

Parameters

string $basePath The base path to be prepended to relative paths
string $version The package version
string $format The format used to apply the version

public string getVersion()

Returns the asset package version.

Return Value

string The version string

public 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

public string getBasePath()

Returns the base path.

Return Value

string The base path

© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.7/Symfony/Component/Templating/Asset/PathPackage.html