You are here

public function Twig_Extension_Core::getFunctions in Translation template extractor 6.3

Same name and namespace in other branches
  1. 7.3 vendor/Twig/Extension/Core.php \Twig_Extension_Core::getFunctions()

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

Return value

array An array of global functions

Overrides Twig_Extension::getFunctions

File

vendor/Twig/Extension/Core.php, line 210

Class

Twig_Extension_Core

Code

public function getFunctions() {
  return array(
    new Twig_SimpleFunction('max', 'max'),
    new Twig_SimpleFunction('min', 'min'),
    new Twig_SimpleFunction('range', 'range'),
    new Twig_SimpleFunction('constant', 'twig_constant'),
    new Twig_SimpleFunction('cycle', 'twig_cycle'),
    new Twig_SimpleFunction('random', 'twig_random', array(
      'needs_environment' => true,
    )),
    new Twig_SimpleFunction('date', 'twig_date_converter', array(
      'needs_environment' => true,
    )),
    new Twig_SimpleFunction('include', 'twig_include', array(
      'needs_environment' => true,
      'needs_context' => true,
      'is_safe' => array(
        'all',
      ),
    )),
    new Twig_SimpleFunction('source', 'twig_source', array(
      'needs_environment' => true,
      'is_safe' => array(
        'all',
      ),
    )),
  );
}