public static function compileTemplate(&$context, $template) {
        array_unshift($context['parsed'], array());
        Validator::verify($context, $template);
        static::$lastParsed = $context['parsed'];

        if (count($context['error'])) {
            return;
        }

        Parser::setDelimiter($context);

        $context['compile'] = true;

        // Handle dynamic partials
        Partial::handleDynamic($context);

        // Do PHP code generation.
        $code = '';
        foreach ($context['parsed'][0] as $info) {
            if (is_array($info)) {
                $context['tokens']['current']++;
                $code .= "'" . static::compileToken($context, $info) . "'";
            } else {
                $code .= $info;
            }
        }

        array_shift($context['parsed']);

        return $code;
    }
public static function compileTemplate(&$context, $template) {
        array_unshift($context['parsed'], array());
        Validator::verify($context, $template);
        static::$lastParsed = $context['parsed'];

        if (count($context['error'])) {
            return;
        }

        Parser::setDelimiter($context);

        $context['compile'] = true;

        // Handle dynamic partials
        Partial::handleDynamic($context);

        // Do PHP code generation.
        $code = '';
        foreach ($context['parsed'][0] as $info) {
            if (is_array($info)) {
                $context['tokens']['current']++;
                $code .= "'" . static::compileToken($context, $info) . "'";
            } else {
                $code .= $info;
            }
        }

        array_shift($context['parsed']);

        return $code;
    }
public static function compileTemplate ( & $ context , $ template ) { array_unshift ( $ context [ 'parsed' ] , array ( ) ) ; Validator :: verify ( $ context , $ template ) ; static :: $ lastParsed = $ context [ 'parsed' ] ; if ( count ( $ context [ 'error' ] ) ) { return ; } Parser :: setDelimiter ( $ context ) ; $ context [ 'compile' ] = true ; // Handle dynamic partials Partial :: handleDynamic ( $ context ) ; // Do PHP code generation. $ code = '' ; foreach ( $ context [ 'parsed' ] [ 0 ] as $ info ) { if ( is_array ( $ info ) ) { $ context [ 'tokens' ] [ 'current' ] ++ ; $ code .= "'" . static :: compileToken ( $ context , $ info ) . "'" ; } else { $ code .= $ info ; } } array_shift ( $ context [ 'parsed' ] ) ; return $ code ; }
Compile template into PHP code

@param array<string,array|string|integer> $context Current context
@param string $template handlebars template

@return string|null generated PHP code
Compile template into PHP code