加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

perl – 如何在字符串而不是文件上使用Template Toolkit?

发布时间:2020-12-15 23:28:07 所属栏目:大数据 来源:网络整理
导读:我有一些字符串,我从数据库中提取出来,我想在它们上使用Template Toolkit,但我似乎无法弄清楚如何使用字符串作为TT输入.有小费吗? 谢谢! -fREW 解决方法 文档说明: process($template,%vars,$output,%options) The process() method is called to proces
我有一些字符串,我从数据库中提取出来,我想在它们上使用Template Toolkit,但我似乎无法弄清楚如何使用字符串作为TT输入.有小费吗?

谢谢!

-fREW

解决方法

文档说明:

process($template,%vars,$output,%options)

The process() method is called to process a template. The first parameter indicates the input template as one of: a filename relative to INCLUDE_PATH,if defined; a reference to a text string containing the template text; …

# text reference
       $tt->process($text)
           || die $tt->error(),"n"

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读