LightnCandy\Compiler::compileOutput PHP Метод

compileOutput() защищенный статический Метод

Return compiled PHP code for template output
protected static compileOutput ( array\arraystring | integer> &$context, string $variable, string $expression, boolean $raw, boolean $nosep ) : string
$context array\arraystring | integer>
$variable string PHP code for the variable
$expression string normalized handlebars expression
$raw boolean is this {{{ token or not
$nosep boolean true to compile without seperator
Результат string Return compiled code segment for the token
    protected static function compileOutput(&$context, $variable, $expression, $raw, $nosep)
    {
        $sep = $nosep ? '' : $context['ops']['seperator'];
        if ($context['flags']['hbesc'] || $context['flags']['jsobj'] || $context['flags']['jstrue'] || $context['flags']['debug'] || $nosep) {
            return $sep . static::getFuncName($context, $raw ? 'raw' : $context['ops']['enc'], $expression) . "\$cx, {$variable}){$sep}";
        } else {
            return $raw ? "{$sep}{$variable}{$context['ops']['seperator']}" : "{$context['ops']['seperator']}htmlentities((string){$variable}, ENT_QUOTES, 'UTF-8'){$sep}";
        }
    }