public static function compileStatic(&$context, $name) {
        // Check for recursive partial
        if (!$context['flags']['runpart']) {
            $context['partialStack'][] = $name;
            $diff = count($context['partialStack']) - count(array_unique($context['partialStack']));
            if ($diff) {
                $context['error'][] = 'I found recursive partial includes as the path: ' . implode(' -> ', $context['partialStack']) . '! You should fix your template or compile with LightnCandy::FLAG_RUNTIMEPARTIAL flag.';
            }
        }

        $code = Compiler::compileTemplate($context, preg_replace('/^/m', $context['tokens']['partialind'], $context['usedPartial'][$name]));

        if (!$context['flags']['runpart']) {
            array_pop($context['partialStack']);
        }

        return $code;
    }
public static function compileStatic(&$context, $name) {
        // Check for recursive partial
        if (!$context['flags']['runpart']) {
            $context['partialStack'][] = $name;
            $diff = count($context['partialStack']) - count(array_unique($context['partialStack']));
            if ($diff) {
                $context['error'][] = 'I found recursive partial includes as the path: ' . implode(' -> ', $context['partialStack']) . '! You should fix your template or compile with LightnCandy::FLAG_RUNTIMEPARTIAL flag.';
            }
        }

        $code = Compiler::compileTemplate($context, preg_replace('/^/m', $context['tokens']['partialind'], $context['usedPartial'][$name]));

        if (!$context['flags']['runpart']) {
            array_pop($context['partialStack']);
        }

        return $code;
    }
public static function compileStatic ( & $ context , $ name ) { // Check for recursive partial if ( ! $ context [ 'flags' ] [ 'runpart' ] ) { $ context [ 'partialStack' ] [ ] = $ name ; $ diff = count ( $ context [ 'partialStack' ] ) - count ( array_unique ( $ context [ 'partialStack' ] ) ) ; if ( $ diff ) { $ context [ 'error' ] [ ] = 'I found recursive partial includes as the path: ' . implode ( ' -> ' , $ context [ 'partialStack' ] ) . '! You should fix your template or compile with LightnCandy::FLAG_RUNTIMEPARTIAL flag.' ; } } $ code = Compiler :: compileTemplate ( $ context , preg_replace ( '/^/m' , $ context [ 'tokens' ] [ 'partialind' ] , $ context [ 'usedPartial' ] [ $ name ] ) ) ; if ( ! $ context [ 'flags' ] [ 'runpart' ] ) { array_pop ( $ context [ 'partialStack' ] ) ; } return $ code ; }
compile a partial to static embed PHP code

@param array<string,array|string|integer> $context Current context of compiler progress.
@param string $name partial name

@return string|null $code PHP code string
compile a partial to static embed PHP code