Class Twig_Extension_Core

InheritanceTwig_Extension_Core » Twig_Extension
ImplementsTwig_ExtensionInterface

Public Methods

Hide inherited methods

MethodDescriptionDefined By
getDateFormat() Gets the default format to be used by the date filter. Twig_Extension_Core
getEscapers() Gets all defined escapers. Twig_Extension_Core
getFilters() Twig_Extension_Core
getFunctions() Twig_Extension_Core
getGlobals() {@inheritdoc} Twig_Extension
getName() Twig_Extension_Core
getNodeVisitors() {@inheritdoc} Twig_Extension
getNumberFormat() Get the default format used by the number_format filter. Twig_Extension_Core
getOperators() Twig_Extension_Core
getTests() Twig_Extension_Core
getTimezone() Gets the default timezone to be used by the date filter. Twig_Extension_Core
getTokenParsers() Twig_Extension_Core
initRuntime() {@inheritdoc} Twig_Extension
parseNotTestExpression() Twig_Extension_Core
parseTestExpression() Twig_Extension_Core
setDateFormat() Sets the default format to be used by the date filter. Twig_Extension_Core
setEscaper() Defines a new escaper to be used via the escape filter. Twig_Extension_Core
setNumberFormat() Sets the default format to be used by the number_format filter. Twig_Extension_Core
setTimezone() Sets the default timezone to be used by the date filter. Twig_Extension_Core

Property Details

$dateFormats protected property
protected $dateFormats = ['F j, Y H:i''%d days']
$escapers protected property
protected $escapers = []
$numberFormat protected property
protected $numberFormat = [0'.'',']
$timezone protected property
protected $timezone null

Method Details

getDateFormat() public method

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

public array getDateFormat ( )
return array

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

getEscapers() public method

Gets all defined escapers.

public array getEscapers ( )
return array

An array of escapers

getFilters() public method

public void getFilters ( )
getFunctions() public method

public void getFunctions ( )
getName() public method

public void getName ( )
getNumberFormat() public method

Get the default format used by the number_format filter.

public array getNumberFormat ( )
return array

The arguments for number_format()

getOperators() public method

public void getOperators ( )
getTest() protected method

protected void getTest ( Twig_Parser $parser, $line )
$parser
$line
getTestNodeClass() protected method

protected void getTestNodeClass ( Twig_Parser $parser, $test )
$parser
$test
getTests() public method

public void getTests ( )
getTimezone() public method

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

public DateTimeZone getTimezone ( )
return DateTimeZone

The default timezone currently in use

getTokenParsers() public method

public void getTokenParsers ( )
parseNotTestExpression() public method

public void parseNotTestExpression ( Twig_Parser $parser, Twig_NodeInterface $node )
$parser
$node
parseTestExpression() public method

public void parseTestExpression ( Twig_Parser $parser, Twig_NodeInterface $node )
$parser
$node
setDateFormat() public method

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

public void setDateFormat ( $format null, $dateIntervalFormat null )
$format string

The default date format string

$dateIntervalFormat string

The default date interval format string

setEscaper() public method

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

public void setEscaper ( $strategy, $callable )
$strategy string

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

$callable callable

A valid PHP callable

setNumberFormat() public method

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

public void setNumberFormat ( $decimal, $decimalPoint, $thousandSep )
$decimal int

The number of decimal places to use.

$decimalPoint string

The character(s) to use for the decimal point.

$thousandSep string

The character(s) to use for the thousands separator.

setTimezone() public method

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

public void setTimezone ( $timezone )
$timezone DateTimeZone|string

The default timezone string or a DateTimeZone object