src/Template.php
static public function replace(string $template, array $params = []): string
    {
        foreach ($params as $k => $v) {
            $template = str_replace('{$' . $k . '}', $v, $template);
        }
        return $template;
    }
static public function replace(string $template, array $params = []): string
    {
        foreach ($params as $k => $v) {
            $template = str_replace('{$' . $k . '}', $v, $template);
        }
        return $template;
    }
简单模板替换
@param $template string 模板源
@param array $params 替换变量值 对
@return string 替换后的模板