src/Twig.php
static function apply() {
        foreach (self::$filters as $name => $callback) {
            \Twig::addFilter(new \Twig_SimpleFilter($name, $callback));
        }
        foreach (self::$functions as $name => $callback) {
            \Twig::addFunction(new \Twig_SimpleFunction($name, $callback));
        }
        foreach (self::$tests as $name => $callback) {
            \Twig::addTest(new \Twig_SimpleTest($name, $callback));
        }
        foreach (self::$extensions as $name) {
            \Twig::addExtension(new $name);
        }
        foreach (self::$globals as $k => $v) {
            \Twig::addGlobal($k, $v);
        }
    }
static function apply() {
        foreach (self::$filters as $name => $callback) {
            \Twig::addFilter(new \Twig_SimpleFilter($name, $callback));
        }
        foreach (self::$functions as $name => $callback) {
            \Twig::addFunction(new \Twig_SimpleFunction($name, $callback));
        }
        foreach (self::$tests as $name => $callback) {
            \Twig::addTest(new \Twig_SimpleTest($name, $callback));
        }
        foreach (self::$extensions as $name) {
            \Twig::addExtension(new $name);
        }
        foreach (self::$globals as $k => $v) {
            \Twig::addGlobal($k, $v);
        }
    }
Добавление в Twig всех зарегистрированных функций, фильтров и тестов