Extension
extends AbstractExtension
in package
The System Twig extension class implements common Twig functions and filters.
Tags
Table of Contents
- $markupManager : MarkupManager
- __construct() : mixed
- Creates the extension instance.
- appFilter() : string
- Converts supplied URL to one relative to the website root.
- getFilters() : array<string|int, mixed>
- Returns a list of filters this extensions provides.
- getFunctions() : array<string|int, mixed>
- Returns a list of functions to add to the existing list.
- 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, mixed>
- Returns a list of token parsers this extensions provides.
- mediaFilter() : string
- Converts supplied file to a URL relative to the media library.
Properties
$markupManager
protected
MarkupManager
$markupManager
A reference to the markup manager instance.
Methods
__construct()
Creates the extension instance.
public
__construct() : mixed
Return values
mixed —appFilter()
Converts supplied URL to one relative to the website root.
public
appFilter(mixed $url) : string
Parameters
- $url : mixed
-
Specifies the application-relative URL
Return values
string —getFilters()
Returns a list of filters this extensions provides.
public
getFilters() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array of filters
getFunctions()
Returns a list of functions to add to the existing list.
public
getFunctions() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array of functions
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 a list of token parsers this extensions provides.
public
getTokenParsers() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array of token parsers
mediaFilter()
Converts supplied file to a URL relative to the media library.
public
mediaFilter(string $file) : string
Parameters
- $file : string
-
Specifies the media-relative file