src/Template.php
public function cloneRegion($tag)
    {
        if ($this->isTopTag($tag)) {
            return clone $this;
        }

        $cl = get_class($this);
        $n = new $cl();
        $n->app = $this->app;
        $n->template = unserialize(serialize(['_top#1' => $this->get($tag)]));
        $n->rebuildTags();
        $n->source = 'clone ('.$tag.') of template '.$this->source;

        return $n;
    }
public function cloneRegion($tag)
    {
        if ($this->isTopTag($tag)) {
            return clone $this;
        }

        $cl = get_class($this);
        $n = new $cl();
        $n->app = $this->app;
        $n->template = unserialize(serialize(['_top#1' => $this->get($tag)]));
        $n->rebuildTags();
        $n->source = 'clone ('.$tag.') of template '.$this->source;

        return $n;
    }
public function cloneRegion ( $ tag ) { if ( $ this -> isTopTag ( $ tag ) ) { return clone $ this ; } $ cl = get_class ( $ this ) ; $ n = new $ cl ( ) ; $ n -> app = $ this -> app ; $ n -> template = unserialize ( serialize ( [ '_top#1' => $ this -> get ( $ tag ) ] ) ) ; $ n -> rebuildTags ( ) ; $ n -> source = 'clone (' . $ tag . ') of template ' . $ this -> source ; return $ n ; }
Creates a new template using portion of existing template.

@param string $tag

@return self
Creates a new template using portion of existing template .