class AssetExtension extends AbstractExtension
Twig extension for the Symfony Asset component.
__construct(Packages $packages) | ||
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. |
Packages | $packages |
{@inheritdoc}
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.
string | $path | A public path |
string | $packageName | The name of the asset package to use |
string | The public path of the asset |
Returns the version of an asset.
string | $path | A public path |
string | $packageName | The name of the asset package to use |
string | The asset version |
Returns the name of the extension.
string | The extension name |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Bridge/Twig/Extension/AssetExtension.html