Think/Template/TagLib/Cx.php
public function _switch(array $tag = [], $content = '')
    {
        $name = $tag['name'];
        $varArray = explode('|', $name);
        $name = array_shift($varArray);
        $name = $this->autoBuildVar($name);
        if (count($varArray) > 0) {
            $name = $this->tpl->parseVarFunction($name, $varArray);
        }

        return '<?php switch('.$name.'): ?>'.$content.'<?php endswitch;?>';
    }
public function _switch(array $tag = [], $content = '')
    {
        $name = $tag['name'];
        $varArray = explode('|', $name);
        $name = array_shift($varArray);
        $name = $this->autoBuildVar($name);
        if (count($varArray) > 0) {
            $name = $this->tpl->parseVarFunction($name, $varArray);
        }

        return '<?php switch('.$name.'): ?>'.$content.'<?php endswitch;?>';
    }
switch标签解析
格式：
<switch name="a.name" >
<case value="1" break="false">1</case>
<case value="2" >2</case>
<default />other
</switch>


@param array $tag 标签属性
@param string $content 标签内容

@return string