LightnCandy\LightnCandy::compilePartial PHP Method

compilePartial() public static method

Compile handlebars partial into PHP function code.
public static compilePartial ( string $template, array\arraystring | integer> $options = ['flags' => self::FLAG_BESTPERFORMANCE] ) : string | false
$template string handlebars template string
$options array\arraystring | integer>
return string | false Compiled PHP code when successed. If error happened and compile failed, return false.
    public static function compilePartial($template, $options = array('flags' => self::FLAG_BESTPERFORMANCE))
    {
        $context = Context::create($options);
        if (static::handleError($context)) {
            return false;
        }
        $code = Partial::compile($context, $template);
        static::$lastParsed = Compiler::$lastParsed;
        // return false when fatal error
        if (static::handleError($context)) {
            return false;
        }
        return $code;
    }