public function getFunction($name)
    {
        $name = $this->getShortcut($name);

        // Check if we have looked this alias up before
        if ($function = $this->getLookup($name)) {
            return $function;
        }

        // Get the class / method we are trying to call
        $parts = $this->getAliasParts($name);

        if ($parts === false) {
            return false;
        }

        list($class, $method) = $parts;
        $class = strtolower($class);

        // Does that alias exist
        if (array_key_exists($class, $this->aliases)) {

            $class    = $this->aliases[$class];
            $function = new TwigFunction($name, $class.'::'.$method);

            $this->setLookup($name, $function);

            return $function;
        }

        return false;
    }
public function getFunction($name)
    {
        $name = $this->getShortcut($name);

        // Check if we have looked this alias up before
        if ($function = $this->getLookup($name)) {
            return $function;
        }

        // Get the class / method we are trying to call
        $parts = $this->getAliasParts($name);

        if ($parts === false) {
            return false;
        }

        list($class, $method) = $parts;
        $class = strtolower($class);

        // Does that alias exist
        if (array_key_exists($class, $this->aliases)) {

            $class    = $this->aliases[$class];
            $function = new TwigFunction($name, $class.'::'.$method);

            $this->setLookup($name, $function);

            return $function;
        }

        return false;
    }
public function getFunction ( $ name ) { $ name = $ this -> getShortcut ( $ name ) ; // Check if we have looked this alias up before if ( $ function = $ this -> getLookup ( $ name ) ) { return $ function ; } // Get the class / method we are trying to call $ parts = $ this -> getAliasParts ( $ name ) ; if ( $ parts === false ) { return false ; } list ( $ class , $ method ) = $ parts ; $ class = strtolower ( $ class ) ; // Does that alias exist if ( array_key_exists ( $ class , $ this -> aliases ) ) { $ class = $ this -> aliases [ $ class ] ; $ function = new TwigFunction ( $ name , $ class . '::' . $ method ) ; $ this -> setLookup ( $ name , $ function ) ; return $ function ; } return false ; }
Allow Twig to call Aliased function from an undefined function.

@param string $name Undefined function name.

@return TwigFunction|false
Allow Twig to call Aliased function from an undefined function .