protected function parseTemplate($str)
    {
        $tag = '/{([\/$]?[-_:\w]*)}/';

        $input = preg_split($tag, $str, -1, PREG_SPLIT_DELIM_CAPTURE);

        $prefix = current($input);
        next($input);
        $this->template = [$prefix];

        $this->parseTemplateRecursive($input, $this->template);
    }