\Twig_Extension_Core

Summary

Methods
Properties
Constants
getTokenParsers()
getNodeVisitors()
getFilters()
getTests()
getFunctions()
getOperators()
setEscaper()
getEscapers()
setDateFormat()
getDateFormat()
setTimezone()
getTimezone()
setNumberFormat()
getNumberFormat()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$dateFormats
$numberFormat
$timezone
$escapers
N/A

Properties

$dateFormats

$dateFormats : 

Type

$numberFormat

$numberFormat : 

Type

$timezone

$timezone : 

Type

$escapers

$escapers : 

Type

Methods

getTokenParsers()

getTokenParsers() : array<mixed,\Twig_TokenParserInterface>

Returns the token parser instances to add to the existing list.

Returns

array<mixed,\Twig_TokenParserInterface>

getNodeVisitors()

getNodeVisitors() : array<mixed,\Twig_NodeVisitorInterface>

Returns the node visitor instances to add to the existing list.

Returns

array<mixed,\Twig_NodeVisitorInterface>

getFilters()

getFilters() : array<mixed,\Twig_Filter>

Returns a list of filters to add to the existing list.

Returns

array<mixed,\Twig_Filter>

getTests()

getTests() : array<mixed,\Twig_Test>

Returns a list of tests to add to the existing list.

Returns

array<mixed,\Twig_Test>

getFunctions()

getFunctions() : array<mixed,\Twig_Function>

Returns a list of functions to add to the existing list.

Returns

array<mixed,\Twig_Function>

getOperators()

getOperators() : \array<array>

Returns a list of operators to add to the existing list.

Returns

\array

First array of unary operators, second array of binary operators

setEscaper()

setEscaper(string  $strategy, callable  $callable) 

Defines a new escaper to be used via the escape filter.

Parameters

string $strategy

The strategy name that should be used as a strategy in the escape call

callable $callable

A valid PHP callable

getEscapers()

getEscapers() : array<mixed,callable>

Gets all defined escapers.

Returns

array<mixed,callable> —

An array of escapers

setDateFormat()

setDateFormat(string  $format = null, string  $dateIntervalFormat = null) 

Sets the default format to be used by the date filter.

Parameters

string $format

The default date format string

string $dateIntervalFormat

The default date interval format string

getDateFormat()

getDateFormat() : array

Gets the default format to be used by the date filter.

Returns

array —

The default date format string and the default date interval format string

setTimezone()

setTimezone(\DateTimeZone|string  $timezone) 

Sets the default timezone to be used by the date filter.

Parameters

\DateTimeZone|string $timezone

The default timezone string or a DateTimeZone object

getTimezone()

getTimezone() : \DateTimeZone

Gets the default timezone to be used by the date filter.

Returns

\DateTimeZone —

The default timezone currently in use

setNumberFormat()

setNumberFormat(integer  $decimal, string  $decimalPoint, string  $thousandSep) 

Sets the default format to be used by the number_format filter.

Parameters

integer $decimal

the number of decimal places to use

string $decimalPoint

the character(s) to use for the decimal point

string $thousandSep

the character(s) to use for the thousands separator

getNumberFormat()

getNumberFormat() : array

Get the default format used by the number_format filter.

Returns

array —

The arguments for number_format()