new-inventor/template

字符串替换的模板类

1.0.0 2016-04-07 08:11 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:53:06 UTC


README

#Template

用于替换占位符的类。占位符的边界在配置 $config['template']['borders'] 中定义。示例配置可以在 src/config/default 文件中查看。

使用

$template = new Template($someString)

$placeholders = $template->getPlaceholders();
foreach($placeholders as $placeholder){
    do something ..
    $template->addReplacement($resString);
}

return $template->getReplaced();