Think/Template/TagLib.php
public function parseCondition($condition)
    {
        $condition = str_ireplace(array_keys($this->comparison), array_values($this->comparison), $condition);
        $condition = preg_replace('/\$(\w+):(\w+)\s/is', '$\\1->\\2 ', $condition);
        return preg_replace('/\$(\w+)\.(\w+)\s/is', '$\\1["\\2"] ', $condition);
    }
public function parseCondition($condition)
    {
        $condition = str_ireplace(array_keys($this->comparison), array_values($this->comparison), $condition);
        $condition = preg_replace('/\$(\w+):(\w+)\s/is', '$\\1->\\2 ', $condition);
        return preg_replace('/\$(\w+)\.(\w+)\s/is', '$\\1["\\2"] ', $condition);
    }
解析条件表达式


@param string $condition 表达式标签内容

@return array