class AssetExtension extends AbstractExtension

Twig extension for the Symfony Asset component.

Methods

__construct(Packages $packages)

No description

getFunctions()

{@inheritdoc}

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

Returns the public url/path of an asset.

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

Returns the version of an asset.

string
getName()

Returns the name of the extension.

Details

at line 27
__construct(Packages $packages)

Parameters

Packages $packages

at line 35
getFunctions()

{@inheritdoc}

at line 54
string getAssetUrl(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 67
string getAssetVersion(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 77
string getName()

Returns the name of the extension.

Return Value

string The extension name