Twig_Extension_Core

Extends\Twig\Extension\CoreExtension

package

Default

Methods

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

getDateFormat(): array
inherited

Response

array

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

Gets all defined escapers.

getEscapers(): array
inherited

Response

array

An array of escapers

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

getFilters(): array<mixed,\Twig\TwigFilter>
inherited

Response

array<mixed,\Twig\TwigFilter>

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

getFunctions(): array<mixed,\Twig\TwigFunction>
inherited

Response

array<mixed,\Twig\TwigFunction>

Returns a list of global variables to add to the existing list.

getGlobals(): array
inherited
deprecated

since 1.23 (to be removed in 2.0), implement \Twig_Extension_GlobalsInterface instead

Response

array

An array of global variables

Returns the name of the extension.

getName(): string
inherited
deprecated

since 1.26 (to be removed in 2.0), not used anymore internally

Response

string

The extension name

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

getNodeVisitors(): array<mixed,\Twig\NodeVisitor\NodeVisitorInterface>
inherited

Get the default format used by the number_format filter.

getNumberFormat(): array
inherited

Response

array

The arguments for number_format()

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

getOperators(): \Twig\Extension\array<array>
inherited

Response

\Twig\Extension\array

First array of unary operators, second array of binary operators

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

getTests(): array<mixed,\Twig\TwigTest>
inherited

Response

array<mixed,\Twig\TwigTest>

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

getTimezone(): \DateTimeZone
inherited

Response

\DateTimeZone

The default timezone currently in use

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

getTokenParsers(): array<mixed,\Twig\TokenParser\TokenParserInterface>
inherited

Initializes the runtime environment.

initRuntime(\Twig\Environment $environment)
inherited

This is where you can load some file that contains filter functions for instance.

deprecated

since 1.23 (to be removed in 2.0), implement \Twig_Extension_InitRuntimeInterface instead

Arguments

$environment

\Twig\Environment

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

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

Arguments

$format

string

The default date format string

$dateIntervalFormat

string

The default date interval format string

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

setEscaper(string $strategy,callable $callable)
inherited

Arguments

$strategy

string

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

$callable

callable

A valid PHP callable

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

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

Arguments

$decimal

integer

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

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

setTimezone(\DateTimeZone|string $timezone)
inherited

Arguments

$timezone

\DateTimeZone|string

The default timezone string or a \DateTimeZone object

Properties

dateFormats

dateFormats :
inherited

Type(s)

numberFormat

numberFormat :
inherited

Type(s)

timezone

timezone :
inherited

Type(s)

escapers

escapers :
inherited

Type(s)