delphi模板引擎
开源地址:https://github.com/sempare/sempare-delphi-template-engine
可能适用的场景:
- 使用模板引擎(或语言)的网站
- 代码生成
- 邮件合并
- 通知消息
用法示例:
program Example; uses Sempare.Template; type TInformation = record name: string; favourite_sport : string; count : integer; end; begin var tpl := Template.Parse( 'My name is <% name %>.'#13#10 + 'My favourite sport is <% favourite_sport %>.'#13#10 + 'Counting... <% for i := 1 to count %><% i %><% betweenitems %>, <% end %>' ); var info : TInformation; info.name := 'conrad'; info.favourite_sport := 'ultimate'; info.count := 3; writeln(Template.Eval(tpl, info)); end.
标签:info,favourite,delphi,引擎,Template,sport,模板 From: https://www.cnblogs.com/hnxxcxg/p/17021121.html