lib/adapter/Wind.php
private function parseExtend($template)
    {
        // {ext ...}
        if (!preg_match("/\\{ext\\s+(.*?)\\}/is", $template, $match)) {
            return $template;
        }
        
        $masterPath  = $this->getTplPath($match[1] . '.html');
        $masterTpl   = @file_get_contents($masterPath);
        $masterTpl   = $this->clearCommentTag($masterTpl);
        
        $masterBlock = $this->getBlock($masterTpl);
        $extBlock    = $this->getBlock($template);
        
        // 母版内容替换
        $template = $masterTpl;
        foreach ($masterBlock as $blockName => $masterContent) {
            if (empty($extBlock[$blockName])) {
                continue;
            }
            $extContent = $extBlock[$blockName];
            
            // 重写的区块可以用 {parent} 调出父模板的内容
            if (strpos($extContent, '{parent}') !== false) { // 有 {parent}
                $extBlock[$blockName] = str_replace('{parent}', $masterBlock[$blockName], $extContent);
            }
            
            // 提取 {block ... } ... {/block}
            $template = preg_replace("/\\{block\\s+{$blockName}\\}(.*?)\\{\\/block\}/is", $extBlock[$blockName], $template);
        }
        
        // 清除未重写的区块标签名
        $template = preg_replace("/\\{block.*?\\}(.*?)\\{\\/block\\}/is", "\\1", $template);
        
        // 不支持多重继承，清除继承标签 {ext ...}
        $template = preg_replace("/\\{ext(.*?)\\}/is", '', $template);
        
        return $template;
    }
private function parseExtend($template)
    {
        // {ext ...}
        if (!preg_match("/\\{ext\\s+(.*?)\\}/is", $template, $match)) {
            return $template;
        }
        
        $masterPath  = $this->getTplPath($match[1] . '.html');
        $masterTpl   = @file_get_contents($masterPath);
        $masterTpl   = $this->clearCommentTag($masterTpl);
        
        $masterBlock = $this->getBlock($masterTpl);
        $extBlock    = $this->getBlock($template);
        
        // 母版内容替换
        $template = $masterTpl;
        foreach ($masterBlock as $blockName => $masterContent) {
            if (empty($extBlock[$blockName])) {
                continue;
            }
            $extContent = $extBlock[$blockName];
            
            // 重写的区块可以用 {parent} 调出父模板的内容
            if (strpos($extContent, '{parent}') !== false) { // 有 {parent}
                $extBlock[$blockName] = str_replace('{parent}', $masterBlock[$blockName], $extContent);
            }
            
            // 提取 {block ... } ... {/block}
            $template = preg_replace("/\\{block\\s+{$blockName}\\}(.*?)\\{\\/block\}/is", $extBlock[$blockName], $template);
        }
        
        // 清除未重写的区块标签名
        $template = preg_replace("/\\{block.*?\\}(.*?)\\{\\/block\\}/is", "\\1", $template);
        
        // 不支持多重继承，清除继承标签 {ext ...}
        $template = preg_replace("/\\{ext(.*?)\\}/is", '', $template);
        
        return $template;
    }
解析模板继承
@param string $template
@return string