AssetExtension
extends AbstractExtension
in package
Twig extension for the Symfony Asset component.
Tags
Table of Contents
- $packages : mixed
- __construct() : mixed
- getAssetUrl() : string
- Returns the public url/path of an asset.
- getAssetVersion() : string
- Returns the version of an asset.
- getFilters() : array<string|int, TwigFilter>
- Returns a list of filters to add to the existing list.
- getFunctions() : array<string|int, TwigFunction>
- Returns a list of functions to add to the existing list.
- getName() : string
- Returns the name of the extension.
- getNodeVisitors() : array<string|int, NodeVisitorInterface>
- Returns the node visitor instances to add to the existing list.
- getOperators() : array<string|int, array<string|int, mixed>>
- Returns a list of operators to add to the existing list.
- getTests() : array<string|int, TwigTest>
- Returns a list of tests to add to the existing list.
- getTokenParsers() : array<string|int, TokenParserInterface>
- Returns the token parser instances to add to the existing list.
Properties
$packages
private
mixed
$packages
Methods
__construct()
public
__construct(Packages $packages) : mixed
Parameters
- $packages : Packages
Return values
mixed —getAssetUrl()
Returns the public url/path of an asset.
public
getAssetUrl(string $path[, string $packageName = null ]) : string
If the package used to generate the path is an instance of UrlPackage, you will always get a URL and not a path.
Parameters
- $path : string
-
A public path
- $packageName : string = null
-
The name of the asset package to use
Return values
string —The public path of the asset
getAssetVersion()
Returns the version of an asset.
public
getAssetVersion(string $path[, string $packageName = null ]) : string
Parameters
- $path : string
-
A public path
- $packageName : string = null
-
The name of the asset package to use
Return values
string —The asset version
getFilters()
Returns a list of filters to add to the existing list.
public
getFilters() : array<string|int, TwigFilter>
Return values
array<string|int, TwigFilter> —getFunctions()
Returns a list of functions to add to the existing list.
public
getFunctions() : array<string|int, TwigFunction>
Return values
array<string|int, TwigFunction> —getName()
Returns the name of the extension.
public
getName() : string
Return values
string —The extension name
getNodeVisitors()
Returns the node visitor instances to add to the existing list.
public
getNodeVisitors() : array<string|int, NodeVisitorInterface>
Return values
array<string|int, NodeVisitorInterface> —getOperators()
Returns a list of operators to add to the existing list.
public
getOperators() : array<string|int, array<string|int, mixed>>
Return values
array<string|int, array<string|int, mixed>> —First array of unary operators, second array of binary operators
getTests()
Returns a list of tests to add to the existing list.
public
getTests() : array<string|int, TwigTest>
Return values
array<string|int, TwigTest> —getTokenParsers()
Returns the token parser instances to add to the existing list.
public
getTokenParsers() : array<string|int, TokenParserInterface>