public function renderTemplateString(string $template, array $variables = []): string
    {
        $output = $this->indexControlStructure($template, 'foreach');
        $output = $this->indexControlStructure($output, 'if', ['else']);

        $output = $this->resolveLoops($output, $variables);
        $output = $this->resolveConditionals($output, $variables);

        return $this->replaceVariablesInTemplate($output, $variables);
    }
public function renderTemplateString(string $template, array $variables = []): string
    {
        $output = $this->indexControlStructure($template, 'foreach');
        $output = $this->indexControlStructure($output, 'if', ['else']);

        $output = $this->resolveLoops($output, $variables);
        $output = $this->resolveConditionals($output, $variables);

        return $this->replaceVariablesInTemplate($output, $variables);
    }
public function renderTemplateString ( string $ template , array $ variables = [ ] ) : string { $ output = $ this -> indexControlStructure ( $ template , 'foreach' ) ; $ output = $ this -> indexControlStructure ( $ output , 'if' , [ 'else' ] ) ; $ output = $ this -> resolveLoops ( $ output , $ variables ) ; $ output = $ this -> resolveConditionals ( $ output , $ variables ) ; return $ this -> replaceVariablesInTemplate ( $ output , $ variables ) ; }
Render a given template string

@param string $template  The template string
@param array  $variables The variables assigned to the template

@return string
@throws UndefinedSymbolException
@throws SyntaxErrorException
Render a given template string