lib/adapter/Wind.php
protected function subTpl($m)
    {
        $subTpl = $m[1]; // 匹配的子模板
        if ($this->cfg['compileMerge']) {
            // 合并子模板到主模板
            
            $tplPath = $this->getTplPath($subTpl . '.html');
            $content = file_get_contents($tplPath);
            $content = $this->clearCommentTag($content);
            
            $tplDir = $this->cfg['tplDir'];
            // 多级嵌套包含，尽管支持多级包含，但应该少用多级包含
            for ($i = 0; $i < 6; $i++) {
                // {tpl xx}
                $content = preg_replace_callback("/\\{tpl\\s+['\"]?(.*?)['\"]?\\}/", function($m) use ($tplDir){
                    $tplPath = $this->getTplPath($m[1] . '.html');
                    $content = file_get_contents($tplPath);
                    $content = $this->clearCommentTag($content);
                    return $content;
                }, $content);
            }
            
            return $content;
        } else {
            return "<?php require \$this->getTpl('{$subTpl}.html');?>";
        }
    }
protected function subTpl($m)
    {
        $subTpl = $m[1]; // 匹配的子模板
        if ($this->cfg['compileMerge']) {
            // 合并子模板到主模板
            
            $tplPath = $this->getTplPath($subTpl . '.html');
            $content = file_get_contents($tplPath);
            $content = $this->clearCommentTag($content);
            
            $tplDir = $this->cfg['tplDir'];
            // 多级嵌套包含，尽管支持多级包含，但应该少用多级包含
            for ($i = 0; $i < 6; $i++) {
                // {tpl xx}
                $content = preg_replace_callback("/\\{tpl\\s+['\"]?(.*?)['\"]?\\}/", function($m) use ($tplDir){
                    $tplPath = $this->getTplPath($m[1] . '.html');
                    $content = file_get_contents($tplPath);
                    $content = $this->clearCommentTag($content);
                    return $content;
                }, $content);
            }
            
            return $content;
        } else {
            return "<?php require \$this->getTpl('{$subTpl}.html');?>";
        }
    }
解析子模板标签

@param array $m
@return string