public function getTagRef($tag, &$template)
    {
        if ($this->isTopTag($tag)) {
            $template = &$this->template;

            return $this;
        }

        @list($tag, $ref) = explode('#', $tag);
        if (!$ref) {
            $ref = 1;
        }
        if (!isset($this->tags[$tag])) {
            throw $this->exception('Tag not found in Template')
                ->addMoreInfo('tag', $tag)
                ->addMoreInfo('tags', implode(', ', array_keys($this->tags)))
                ;
        }
        $template = reset($this->tags[$tag]);

        return $this;
    }
public function getTagRef($tag, &$template)
    {
        if ($this->isTopTag($tag)) {
            $template = &$this->template;

            return $this;
        }

        @list($tag, $ref) = explode('#', $tag);
        if (!$ref) {
            $ref = 1;
        }
        if (!isset($this->tags[$tag])) {
            throw $this->exception('Tag not found in Template')
                ->addMoreInfo('tag', $tag)
                ->addMoreInfo('tags', implode(', ', array_keys($this->tags)))
                ;
        }
        $template = reset($this->tags[$tag]);

        return $this;
    }
public function getTagRef ( $ tag , & $ template ) { if ( $ this -> isTopTag ( $ tag ) ) { $ template = & $ this -> template ; return $ this ; } @ list ( $ tag , $ ref ) = explode ( '#' , $ tag ) ; if ( ! $ ref ) { $ ref = 1 ; } if ( ! isset ( $ this -> tags [ $ tag ] ) ) { throw $ this -> exception ( 'Tag not found in Template' ) -> addMoreInfo ( 'tag' , $ tag ) -> addMoreInfo ( 'tags' , implode ( ', ' , array_keys ( $ this -> tags ) ) ) ; } $ template = reset ( $ this -> tags [ $ tag ] ) ; return $ this ; }
This is a helper method which populates an array pointing
to the place in the template referenced by a said tag.

Because there might be multiple tags and getTagRef is
returning only one template, it will return the first
occurence:

{greeting}hello{/},  {greeting}world{/}

calling getTagRef('greeting',$template) will point
second argument towards &array('hello');
This is a helper method which populates an array pointing to the place in the template referenced by a said tag .