Skip to main content

render_template

Function render_template 

Source
pub fn render_template(template: &str, replacements: &[(&str, &str)]) -> String
Expand description

替换模板占位符

对齐 PHP Make::buildClass() 中的 str_replace 调用。

§参数

  • template:模板字符串
  • replacements:占位符 → 替换值(如 {%className%}User