src/Template.php
public function loadTemplateFromString($str)
    {
        $this->source = 'string: '.$str;
        $this->template = $this->tags = [];
        if (!$str) {
            return;
        }
        $this->tag_cnt = [];

        /* First expand self-closing tags {$tag} -> {tag}{/tag} */
        $str = preg_replace('/{\$([-_:\w]+)}/', '{\1}{/\1}', $str);

        $this->parseTemplate($str);

        return $this;
    }
public function loadTemplateFromString($str)
    {
        $this->source = 'string: '.$str;
        $this->template = $this->tags = [];
        if (!$str) {
            return;
        }
        $this->tag_cnt = [];

        /* First expand self-closing tags {$tag} -> {tag}{/tag} */
        $str = preg_replace('/{\$([-_:\w]+)}/', '{\1}{/\1}', $str);

        $this->parseTemplate($str);

        return $this;
    }
public function loadTemplateFromString ( $ str ) { $ this -> source = 'string: ' . $ str ; $ this -> template = $ this -> tags = [ ] ; if ( ! $ str ) { return ; } $ this -> tag_cnt = [ ] ; /* First expand self-closing tags {$tag} -> {tag}{/tag} */ $ str = preg_replace ( '/{\$([-_:\w]+)}/' , '{\1}{/\1}' , $ str ) ; $ this -> parseTemplate ( $ str ) ; return $ this ; }
Initialize current template from the supplied string.

@param string $str

@return $this
Initialize current template from the supplied string .