LightnCandy\Compiler::compileVariable PHP Method

compileVariable() protected static method

Return compiled PHP code for a handlebars variable token
protected static compileVariable ( array\arraystring | integer> &$context, arrayinteger | string | array> &$vars, boolean $raw, boolean $nosep ) : string
$context array\arraystring | integer>
$vars arrayinteger | string | array>
$raw boolean is this {{{ token or not
$nosep boolean true to compile without seperator
return string Return compiled code segment for the token
    protected static function compileVariable(&$context, &$vars, $raw, $nosep)
    {
        if ($context['flags']['lambda']) {
            $V = array_shift($vars);
            $v = static::getVariableName($context, $V, null, count($vars) ? static::getVariableNames($context, $vars) : array('0', array('')));
        } else {
            $v = static::getVariableName($context, $vars[0]);
        }
        return static::compileOutput($context, $v[0], $v[1], $raw, $nosep);
    }