LightnCandy\Compiler::with PHP Method

with() protected static method

compile {{with}} token
protected static with ( array\arraystring | integer> &$context, arrayinteger | string | array> $vars ) : string | null
$context array\arraystring | integer>
$vars arrayinteger | string | array>
return string | null Return compiled code segment for the token
    protected static function with(&$context, $vars)
    {
        $v = isset($vars[1]) ? static::getVariableNameOrSubExpression($context, $vars[1]) : array(null, array());
        $bp = Parser::getBlockParams($vars);
        $bs = $bp ? 'array(' . Expression::listString($bp) . ')' : 'null';
        $be = $bp ? " as |{$bp['0']}|" : '';
        return $context['ops']['seperator'] . static::getFuncName($context, 'wi', 'with ' . $v[1] . $be) . "\$cx, {$v[0]}, {$bs}, \$in, function(\$cx, \$in) {{$context['ops']['f_start']}";
    }