Properties

$extensions

$extensions : 

Type

$initialized

$initialized : 

Type

$runtimeInitialized

$runtimeInitialized : 

Type

$staging

$staging : 

Type

$parsers

$parsers : 

Type

$visitors

$visitors : 

Type

$filters

$filters : 

Type

$tests

$tests : 

Type

$functions

$functions : 

Type

$unaryOperators

$unaryOperators : 

Type

$binaryOperators

$binaryOperators : 

Type

$globals

$globals : 

Type

$functionCallbacks

$functionCallbacks : 

Type

$filterCallbacks

$filterCallbacks : 

Type

$lastModified

$lastModified : 

Type

Methods

__construct()

__construct() 

initRuntime()

initRuntime(\Twig_Environment  $env) 

Initializes the runtime environment.

Parameters

\Twig_Environment $env

hasExtension()

hasExtension(string  $class) : boolean

Returns true if the given extension is registered.

Parameters

string $class

The extension class name

Returns

boolean —

Whether the extension is registered or not

getExtension()

getExtension(string  $class) : \Twig_ExtensionInterface

Gets an extension by class name.

Parameters

string $class

The extension class name

Returns

\Twig_ExtensionInterface

A Twig_ExtensionInterface instance

setExtensions()

setExtensions(array  $extensions) 

Registers an array of extensions.

Parameters

array $extensions

An array of extensions

getExtensions()

getExtensions() : array

Returns all registered extensions.

Returns

array —

An array of extensions

getSignature()

getSignature() 

isInitialized()

isInitialized() 

getLastModified()

getLastModified() 

addExtension()

addExtension(\Twig_ExtensionInterface  $extension) 

Registers an extension.

Parameters

\Twig_ExtensionInterface $extension

A Twig_ExtensionInterface instance

addFunction()

addFunction(\Twig_Function  $function) 

Parameters

\Twig_Function $function

getFunctions()

getFunctions() 

getFunction()

getFunction(string  $name) : \Twig_Function|false

Get a function by name.

Parameters

string $name

function name

Returns

\Twig_Function|false —

A Twig_Function instance or false if the function does not exist

registerUndefinedFunctionCallback()

registerUndefinedFunctionCallback(callable  $callable) 

Parameters

callable $callable

addFilter()

addFilter(\Twig_Filter  $filter) 

Parameters

\Twig_Filter $filter

getFilters()

getFilters() 

getFilter()

getFilter(string  $name) : \Twig_Filter|false

Get a filter by name.

Subclasses may override this method and load filters differently; so no list of filters is available.

Parameters

string $name

The filter name

Returns

\Twig_Filter|false —

A Twig_Filter instance or false if the filter does not exist

registerUndefinedFilterCallback()

registerUndefinedFilterCallback(callable  $callable) 

Parameters

callable $callable

getNodeVisitors()

getNodeVisitors() 

getTokenParsers()

getTokenParsers() 

getGlobals()

getGlobals() 

addTest()

addTest(\Twig_Test  $test) 

Parameters

\Twig_Test $test

getTests()

getTests() 

getTest()

getTest(string  $name) : \Twig_Test|false

Gets a test by name.

Parameters

string $name

The test name

Returns

\Twig_Test|false —

A Twig_Test instance or false if the test does not exist

getUnaryOperators()

getUnaryOperators() : array

Gets the registered unary Operators.

Returns

array —

An array of unary operators

getBinaryOperators()

getBinaryOperators() : array

Gets the registered binary Operators.

Returns

array —

An array of binary operators

initExtensions()

initExtensions()