Google CTemplate:

Here's a simple template:

   <html><head><title>{{TITLE}}</title>{{META_TAGS}}</head>
   <body>{{BODY}}</body>

Here's a dictionary that one could use to instantiate the template:

   {"TITLE": "Template example",
    "BODY": "This is a simple template example./nIt's boring",
    "DATE": "11/20/2005"}

使用CTemplate 初始化字典,也可以修改键值.
然后实例化template,生成输出:
<html><head><title>Template example</title></head>
   <body>This is a simple template example.
It's boring</body></html>

目的:程序功能和输出分离
可用于动态网页生成,但不限于此

clearsilver 也是类似的模板,但用于html生成,不提供 c++,提供c,phthon,perl等接口
有关CTemplate,可以下载源代码包,里面有简单的例子

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值