Habari\HiEngineParser::process PHP Method

process() public method

Process the template file for template tags
public process ( string $template ) : string
$template string The template file contents
return string The processed template
    function process($template)
    {
        $template = preg_replace_callback('/\\{hi:(".+?")((?:\\s*[\\w\\.]+){0,2})\\s*\\}/smu', array($this, 'hi_quote'), $template);
        $template = preg_replace_callback('%\\{hi:([^\\?]+?)\\}(.+?)\\{/hi:\\1\\}%ism', array($this, 'hi_loop'), $template);
        $template = preg_replace_callback('%\\{hi:\\?\\s*(.+?)\\}(.+?)\\{/hi:\\?\\}%ismu', array($this, 'hi_if'), $template);
        $template = preg_replace_callback('%\\{hi:([^:}]+?:.+?)\\}%i', array($this, 'hi_command'), $template);
        $template = preg_replace_callback('%\\{hi:(.+?)\\}%i', array($this, 'hi_var'), $template);
        return $template;
    }